/**
 * Cookie Consent Styles - RGPD/CNIL Compliant
 * SOS Serrurier Paris Express
 */

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    padding: env(safe-area-inset-bottom, 0);
}

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

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .cookie-banner-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #111827;
}

.cookie-banner-text p {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.cookie-link {
    color: #dc2626;
    text-decoration: underline;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.cookie-link:hover {
    color: #991b1b;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* Cookie Buttons */
.cookie-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cookie-btn-primary {
    background: #dc2626;
    color: white;
}

.cookie-btn-primary:hover {
    background: #991b1b;
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.cookie-btn-secondary:hover {
    background: #e5e7eb;
}

.cookie-btn-link {
    background: transparent;
    color: #dc2626;
    text-decoration: underline;
    padding: 0.625rem 0.75rem;
}

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

/* Cookie Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cookie-modal-content {
    position: relative;
    background: white;
    border-radius: 0.75rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

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

.cookie-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6b7280;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.cookie-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.cookie-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-body > p {
    margin-bottom: 1.5rem;
    color: #4b5563;
    line-height: 1.6;
}

.cookie-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Cookie Categories */
.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-category {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.cookie-category-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-info strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #111827;
}

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

.cookie-required {
    font-size: 0.75rem;
    color: #dc2626;
    font-weight: normal;
    margin-left: 0.5rem;
}

/* Cookie Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-switch 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;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-switch input:checked + .cookie-slider {
    background-color: #dc2626;
}

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

.cookie-switch input:disabled + .cookie-slider {
    background-color: #dc2626;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cookie Notification */
.cookie-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #111827;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s;
}

.cookie-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .cookie-banner-content {
        padding: 1rem;
    }

    .cookie-banner-text h3 {
        font-size: 1.125rem;
    }

    .cookie-banner-actions {
        width: 100%;
        justify-content: stretch;
    }

    .cookie-btn {
        flex: 1;
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }

    .cookie-modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

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

    .cookie-modal-header h2 {
        font-size: 1.25rem;
    }

    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-modal,
    .cookie-notification,
    .cookie-slider,
    .cookie-slider:before,
    .cookie-btn {
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cookie-banner {
        border-top: 2px solid #111827;
    }

    .cookie-modal-content {
        border: 2px solid #111827;
    }

    .cookie-btn-secondary {
        border-width: 2px;
    }
}

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