/**
 * Cookie Consent Styles - RGPD Compliant
 * ModernWeb - Bandeau de consentement aux cookies
 */

/* Modal Container */
.cookie-consent-modal {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 9990;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-main, 'Outfit', sans-serif);
}

.cookie-consent-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.cookie-consent-header {
    margin-bottom: 16px;
}

.cookie-consent-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-consent-header h3 span {
    font-size: 1.4rem;
}

.cookie-consent-header p {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Options Container */
.cookie-consent-options {
    margin-top: 16px;
    display: none;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
}

.cookie-consent-options.show {
    display: block;
    animation: fadeInOptions 0.3s ease;
}

@keyframes fadeInOptions {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Individual Cookie Option */
.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    gap: 16px;
}

.cookie-option:last-child {
    border-bottom: none;
}

.cookie-option-label {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cookie-option-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1E293B;
    display: flex;
    align-items: center;
}

.cookie-option-desc {
    font-size: 0.8rem;
    color: #64748B;
    line-height: 1.5;
    margin-top: 4px;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E1;
    transition: 0.3s ease;
    border-radius: 34px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .cookie-slider {
    background-color: #2563EB;
}

input:focus + .cookie-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

input:disabled + .cookie-slider {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #22c55e;
}

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

/* Action Buttons */
.cookie-consent-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cookie-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Accept Button - Primary style */
.cookie-btn-accept {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.cookie-btn-accept:hover {
    background: linear-gradient(135deg, #1D4ED8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* Reject Button - Equal prominence as required by RGPD */
.cookie-btn-reject {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.cookie-btn-reject:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* Outline Button */
.cookie-btn-outline {
    background: transparent;
    border: 2px solid #E2E8F0;
    color: #475569;
}

.cookie-btn-outline:hover {
    border-color: #CBD5E1;
    background: #F8FAFC;
    color: #1E293B;
}

/* Links */
.cookie-links {
    margin-top: 16px;
    text-align: center;
    font-size: 0.8rem;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.cookie-links a {
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
}

.cookie-links a:hover {
    color: #2563EB;
    text-decoration: underline;
}

/* Info Text */
.cookie-info {
    margin-top: 12px;
    text-align: center;
}

.cookie-info small {
    font-size: 0.75rem;
    color: #94A3B8;
    line-height: 1.5;
    display: block;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Toast Notification */
.cookie-toast {
    font-family: var(--font-main, 'Outfit', sans-serif);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .cookie-consent-modal {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 20px;
        transform: translateY(100%);
        max-height: 85vh;
    }

    .cookie-consent-modal.active {
        transform: translateY(0);
    }

    .cookie-consent-header h3 {
        font-size: 1.1rem;
    }

    .cookie-consent-header p {
        font-size: 0.85rem;
    }

    .cookie-option {
        flex-direction: row;
        align-items: center;
    }

    .cookie-btn {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .cookie-links {
        font-size: 0.75rem;
    }

    .cookie-links span {
        display: none;
    }

    .cookie-links a {
        display: block;
        margin: 4px 0;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .cookie-consent-modal {
        max-width: 380px;
        right: 1rem;
        bottom: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-modal {
        border: 2px solid #000;
    }

    .cookie-btn-accept,
    .cookie-btn-reject {
        border: 2px solid currentColor;
    }
}

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

    .cookie-consent-options.show {
        animation: none;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .cookie-consent-modal {
        background: rgba(30, 41, 59, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .cookie-consent-header h3 {
        color: #F1F5F9;
    }

    .cookie-consent-header p,
    .cookie-option-desc {
        color: #94A3B8;
    }

    .cookie-option-title {
        color: #E2E8F0;
    }

    .cookie-option {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .cookie-consent-options {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .cookie-links {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .cookie-links a {
        color: #94A3B8;
    }

    .cookie-btn-outline {
        border-color: rgba(255, 255, 255, 0.2);
        color: #E2E8F0;
    }

    .cookie-btn-outline:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.3);
    }
}
