/**
 * Cookie Consent Styles
 * Matches IMT Insurance brand guidelines
 */

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a2332 0%, #2c3e50 100%);
    color: #ffffff;
    padding: 1.25rem 1rem;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    visibility: hidden;
}

.cookie-consent-banner.show {
    transform: translateY(0);
    visibility: visible;
}

.cookie-consent-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.cookie-consent-content {
    flex: 1 1 500px;
    min-width: 0;
}

.cookie-consent-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-consent-title svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-consent-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.cookie-consent-text a {
    color: #7cb9e8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent-text a:hover {
    color: #a8d4f5;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cookie-btn-primary {
    background: #ec042a;
    color: #ffffff;
}

.cookie-btn-primary:hover {
    background: #c50323;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 4, 42, 0.4);
}

.cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.cookie-btn-link {
    background: transparent;
    color: #7cb9e8;
    padding: 0.625rem 0.75rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-btn-link:hover {
    color: #a8d4f5;
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-dialog {
    background: #ffffff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-settings-modal.show .cookie-settings-dialog {
    transform: translateY(0);
}

.cookie-settings-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-settings-header h2 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a2332;
    margin: 0;
}

.cookie-settings-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-settings-close:hover {
    background: #f3f4f6;
    color: #1a2332;
}

.cookie-settings-close svg {
    width: 24px;
    height: 24px;
}

.cookie-settings-body {
    padding: 1.5rem;
}

.cookie-settings-intro {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 1.5rem 0;
}

.cookie-category {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category-header {
    padding: 1rem 1.25rem;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-category-info {
    flex: 1;
    min-width: 0;
}

.cookie-category-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a2332;
    margin: 0 0 0.25rem 0;
}

.cookie-category-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d1d5db;
    transition: 0.3s;
    border-radius: 28px;
}

.cookie-toggle-slider::before {
    position: absolute;
    content: '';
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #ec042a;
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(24px);
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(236, 4, 42, 0.25);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background: #9ca3af;
    cursor: not-allowed;
}

.cookie-toggle input:disabled + .cookie-toggle-slider::before {
    background: #e5e7eb;
}

.cookie-toggle-required {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.cookie-settings-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    background: #f9fafb;
}

.cookie-btn-modal-primary {
    background: #ec042a;
    color: #ffffff;
}

.cookie-btn-modal-primary:hover {
    background: #c50323;
}

.cookie-btn-modal-secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.cookie-btn-modal-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Footer Cookie Link */
.cookie-settings-link {
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.cookie-settings-link:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .cookie-consent-banner {
        padding: 1rem;
    }

    .cookie-consent-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cookie-consent-actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-settings-dialog {
        max-height: 85vh;
    }

    .cookie-settings-header {
        padding: 1rem;
    }

    .cookie-settings-body {
        padding: 1rem;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cookie-settings-footer {
        padding: 1rem;
        flex-direction: column;
    }

    .cookie-settings-footer .cookie-btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .cookie-consent-banner,
    .cookie-settings-modal {
        display: none !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-settings-modal,
    .cookie-settings-dialog,
    .cookie-toggle-slider,
    .cookie-toggle-slider::before,
    .cookie-btn {
        transition: none;
    }
}
