/* Cookie Manager - Styles modernes et neutres */

:root {
    --cookie-primary: #2c3e50;
    --cookie-button: #3498db;
    --cookie-text: #333;
    --cookie-bg: #ffffff;
    --cookie-shadow: rgba(0, 0, 0, 0.15);
    --cookie-overlay: rgba(0, 0, 0, 0.5);
    --cookie-border: #e0e0e0;
    --cookie-success: #27ae60;
    --cookie-required: #95a5a6;
}

/* Banner principale */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    background: var(--primary-color, var(--cookie-primary));
    color: white;
    padding: 20px;
    box-shadow: 0 -2px 20px var(--cookie-shadow);
    z-index: 9999;
    display: none;
    transform: translateY(0);
    opacity: 1;
}

.cookie-banner.show {
    display: block;
    animation: slideIn 0.5s ease-out forwards;
}

.cookie-banner-bottom {
    bottom: 0;
}

.cookie-banner-top {
    top: 0;
    box-shadow: 0 2px 20px var(--cookie-shadow);
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner-top.show {
    animation-name: slideInTop;
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
}

.cookie-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    opacity: 0.9;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Boutons */
.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.cookie-btn-settings {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-settings:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cookie-btn-accept {
    background: var(--button-color, var(--cookie-button));
    color: white;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal.show {
    display: flex;
    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: var(--cookie-overlay);
    backdrop-filter: blur(2px);
}

.cookie-modal-content {
    position: relative;
    background: var(--cookie-bg);
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.cookie-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--cookie-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--cookie-text);
    font-weight: 600;
}

.cookie-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.cookie-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.cookie-modal-close svg {
    width: 24px;
    height: 24px;
    color: var(--cookie-text);
}

.cookie-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-intro {
    margin: 0 0 25px 0;
    color: #666;
    line-height: 1.6;
}

/* Catégories de cookies */
.cookie-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--cookie-border);
    transition: all 0.2s;
}

.cookie-category:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-category-title h3 {
    margin: 0;
    font-size: 18px;
    color: var(--cookie-text);
    font-weight: 600;
}

.cookie-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookie-badge-required {
    background: var(--cookie-required);
    color: white;
}

.cookie-badge-optional {
    background: #e3f2fd;
    color: #1976d2;
}

.cookie-category-description {
    color: #555;
    line-height: 1.6;
}

.cookie-category-description p {
    margin: 0 0 12px 0;
}

.cookie-details {
    background: white;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

.cookie-details strong {
    color: var(--cookie-text);
}

/* Switch Toggle */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    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: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

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

.cookie-switch input:checked + .cookie-slider {
    background-color: var(--cookie-success);
}

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

.cookie-switch-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-switch-disabled .cookie-slider {
    cursor: not-allowed;
}

/* Privacy Link */
.cookie-privacy-link {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--cookie-border);
    text-align: center;
}

.cookie-privacy-link a {
    color: var(--primary-color, var(--cookie-button));
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.cookie-privacy-link a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Modal Footer */
.cookie-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--cookie-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.cookie-btn-primary {
    background: var(--button-color, var(--cookie-button));
    color: white;
}

.cookie-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: white;
    color: var(--cookie-text);
    border: 1px solid var(--cookie-border);
}

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

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner-text {
        min-width: auto;
        flex-direction: column;
        text-align: center;
    }

    .cookie-banner-actions {
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }

    .cookie-modal-content {
        margin: 10px;
        max-height: 95vh;
    }

    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 20px;
    }

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

    .cookie-btn-primary,
    .cookie-btn-secondary {
        width: 100%;
    }

    .cookie-category-header {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 15px;
    }

    .cookie-banner-text p {
        font-size: 14px;
    }

    .cookie-icon {
        width: 32px;
        height: 32px;
    }

    .cookie-modal-header h2 {
        font-size: 20px;
    }

    .cookie-category-title h3 {
        font-size: 16px;
    }
}
