/* Variables CSS - Surchargées dynamiquement par PHP */
:root {
    --av-cookie-primary: #4CAF50;
    --av-cookie-secondary: #333333;
    --av-cookie-text: #ffffff;
    --av-cookie-button-text: #ffffff;
}

/* Bannière principale */
.av-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    background: var(--av-cookie-secondary);
    color: var(--av-cookie-text);
    z-index: 999999;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.2);
    animation: avCookieSlideIn 0.5s ease-out;
}

/* Logo */
.av-cookie-logo {
    position: absolute;
    z-index: 10;
}

.av-cookie-logo img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Positions du logo */
.av-cookie-logo-top-left {
    top: 15px;
    left: 15px;
}

.av-cookie-logo-top-right {
    top: 15px;
    right: 15px;
}

.av-cookie-logo-bottom-left {
    bottom: 15px;
    left: 15px;
}

.av-cookie-logo-bottom-right {
    bottom: 15px;
    right: 15px;
}

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

.av-cookie-banner-top {
    top: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.av-cookie-banner-center {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: avCookieFadeIn 0.5s ease-out;
}

.av-cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 30px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Position center : forcer en colonne */
.av-cookie-banner-center .av-cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
}

.av-cookie-banner-text {
    flex: 1;
    min-width: 0; /* Important pour éviter que le texte soit écrasé */
}

.av-cookie-banner-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--av-cookie-text);
}

.av-cookie-banner-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--av-cookie-text);
    opacity: 0.95;
}

/* Lien "En savoir plus" */
.av-cookie-learn-more {
    color: var(--av-cookie-text);
    text-decoration: underline;
    opacity: 0.8;
    font-size: 13px;
    margin-left: 5px;
    transition: opacity 0.3s ease;
}

.av-cookie-learn-more:hover {
    opacity: 1;
    text-decoration: underline;
}

.av-cookie-banner-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
}

/* Position center : garder les boutons en ligne */
.av-cookie-banner-center .av-cookie-banner-buttons {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

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

/* Bouton Accepter */
.av-cookie-btn-accept {
    background: var(--av-accept-bg, #4CAF50);
    color: var(--av-accept-text, #ffffff);
    border: var(--av-accept-border-width, 0) solid var(--av-accept-border, #4CAF50);
}

.av-cookie-btn-accept:hover {
    background: var(--av-accept-hover-bg, #45a049);
    color: var(--av-accept-hover-text, #ffffff);
    border-color: var(--av-accept-hover-border, #45a049);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Bouton Refuser */
.av-cookie-btn-refuse {
    background: var(--av-refuse-bg, #f44336);
    color: var(--av-refuse-text, #ffffff);
    border: var(--av-refuse-border-width, 0) solid var(--av-refuse-border, #f44336);
}

.av-cookie-btn-refuse:hover {
    background: var(--av-refuse-hover-bg, #da190b);
    color: var(--av-refuse-hover-text, #ffffff);
    border-color: var(--av-refuse-hover-border, #da190b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Bouton Paramètres */
.av-cookie-btn-settings {
    background: var(--av-settings-bg, #757575);
    color: var(--av-settings-text, #ffffff);
    border: var(--av-settings-border-width, 0) solid var(--av-settings-border, #757575);
}

.av-cookie-btn-settings:hover {
    background: var(--av-settings-hover-bg, #616161);
    color: var(--av-settings-hover-text, #ffffff);
    border-color: var(--av-settings-hover-border, #616161);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Animation d'entrée */
@keyframes avCookieSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes avCookieFadeIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.av-cookie-banner-top {
    animation: avCookieSlideInTop 0.5s ease-out;
}

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

/* Modal des paramètres */
.av-cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: avModalFadeIn 0.3s ease-out;
}

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

.av-cookie-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    animation: avModalSlideIn 0.3s ease-out;
}

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

.av-cookie-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.av-cookie-modal-close:hover {
    color: #333;
}

.av-cookie-modal-content h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.av-cookie-settings-list {
    margin: 20px 0;
}

.av-cookie-setting-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

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

.av-cookie-setting-item h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.av-cookie-setting-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Switch toggle */
.av-cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.av-cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

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

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

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

.av-cookie-switch input:disabled + .av-cookie-slider {
    background-color: #999;
    cursor: not-allowed;
}

.av-cookie-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    justify-content: flex-end;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .av-cookie-banner-content {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .av-cookie-banner-center {
        max-width: 90%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    .av-cookie-banner-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .av-cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .av-cookie-banner-title {
        font-size: 18px;
    }
    
    .av-cookie-banner-description {
        font-size: 13px;
    }
    
    .av-cookie-modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .av-cookie-modal-content h2 {
        font-size: 20px;
        padding-right: 30px;
    }
    
    .av-cookie-modal-buttons {
        flex-direction: column;
    }
    
    .av-cookie-modal-buttons .av-cookie-btn {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .av-cookie-banner-content {
        padding: 15px;
    }
    
    .av-cookie-banner-center {
        max-width: 95%;
        border-radius: 8px;
    }
    
    .av-cookie-banner-title {
        font-size: 16px;
    }
    
    .av-cookie-banner-description {
        font-size: 12px;
    }
    
    .av-cookie-btn {
        padding: 10px 18px;
        font-size: 13px;
    }
}
