/* Cookie Consent Component Styles */

/* Banner Styles */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--light-text);
    border-top: 3px solid var(--brand-navy);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.cookie-banner-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cookie-banner-text h3 {
    margin: 0 0 0.5rem 0;
    color: var(--brand-navy);
    font-size: 1.2rem;
    font-weight: 700;
}

.cookie-banner-text p {
    margin: 0;
    color: var(--dark-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-banner-buttons button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-accept-all {
    background: var(--brand-navy);
    color: var(--light-text);
}

.btn-accept-all:hover {
    background: #0c2a4a;
    transform: translateY(-1px);
}

.btn-reject-all {
    background: var(--light-gray);
    color: var(--dark-text);
    border: 1px solid #ddd;
}

.btn-reject-all:hover {
    background: #e8e8e8;
}

.btn-manage {
    background: transparent;
    color: var(--brand-navy);
    border: 1px solid var(--brand-navy);
}

.btn-manage:hover {
    background: var(--brand-navy);
    color: var(--light-text);
}

/* Modal Styles */
#cookie-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.cookie-modal-content {
    position: relative;
    background: var(--light-text);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { 
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to { 
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.cookie-modal-header {
    padding: 1.5rem 2rem 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 1.5rem;
}

.cookie-modal-header h2 {
    margin: 0;
    color: var(--brand-navy);
    font-size: 1.5rem;
    text-align: left;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--dark-text);
}

.cookie-modal-body {
    padding: 0 2rem;
}

.cookie-modal-body > p {
    margin: 0 0 1.5rem 0;
    color: #666;
    line-height: 1.6;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    background: #fafafa;
}

.cookie-category-header {
    margin-bottom: 0.75rem;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--dark-text);
}

.cookie-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--light-text);
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: var(--brand-navy);
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-slider.disabled {
    background: var(--brand-navy);
    opacity: 0.7;
    cursor: not-allowed;
}

.cookie-toggle input[type="checkbox"]:disabled + .toggle-slider.disabled:before {
    transform: translateX(20px);
}

.cookie-category p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-modal-footer {
    padding: 1.5rem 2rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid var(--light-gray);
    margin-top: 1.5rem;
}

.cookie-modal-footer button {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save {
    background: var(--brand-navy);
    color: var(--light-text);
}

.btn-save:hover {
    background: #0c2a4a;
    transform: translateY(-1px);
}

.btn-reject {
    background: var(--light-gray);
    color: var(--dark-text);
    border: 1px solid #ddd;
}

.btn-reject:hover {
    background: #e8e8e8;
}

/* Floating Settings Button */
#cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--brand-navy);
    color: var(--light-text);
    border: none;
    border-radius: 20px;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(10, 35, 66, 0.3);
    transition: all 0.3s ease;
    z-index: 9998;
}

#cookie-settings-btn:hover {
    background: #0c2a4a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 35, 66, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .cookie-banner-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .cookie-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
    }

    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer button {
        width: 100%;
    }

    #cookie-settings-btn {
        bottom: 15px;
        right: 15px;
        font-size: 0.8rem;
        padding: 0.6rem 0.9rem;
    }
}

@media (max-width: 480px) {
    .cookie-banner-content {
        padding: 1rem 1.5rem;
    }

    .cookie-banner-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cookie-banner-buttons button {
        width: 100%;
        padding: 0.8rem;
    }

    .cookie-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        max-height: none;
    }

    .cookie-category {
        padding: 0.75rem;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    #cookie-consent-banner,
    #cookie-consent-modal,
    .cookie-modal-content {
        animation: none;
    }
}

/* Focus states for accessibility */
.cookie-banner-buttons button:focus,
.cookie-modal-footer button:focus,
#cookie-settings-btn:focus,
.modal-close:focus {
    outline: 2px solid var(--brand-navy);
    outline-offset: 2px;
}

.cookie-toggle:focus-within .toggle-slider {
    box-shadow: 0 0 0 2px var(--brand-navy);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-banner-content,
    .cookie-modal-content {
        border: 2px solid var(--dark-text);
    }
    
    .toggle-slider {
        border: 1px solid var(--dark-text);
    }
}