/* Kel' Étoile Cookie Banner Styles */

#kestelle-cookie-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: 90%;
    background: var(--bg-color) !important;
    background-color: var(--bg-color) !important;
    color: var(--text-color);
    border-radius: var(--border-radius);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

/* Force le fond blanc sur tous les éléments enfants */
#kestelle-cookie-banner * {
    background-color: transparent;
}

#kestelle-cookie-banner.show {
    opacity: var(--opacity);
    visibility: visible;
}

/* Positions */
/* Positions centrées en bas */
#kestelle-cookie-banner.kestelle-position-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
}

#kestelle-cookie-banner.kestelle-position-bottom.show {
    transform: translateX(-50%) translateY(0);
}

/* Positions centrées en haut */
#kestelle-cookie-banner.kestelle-position-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
}

#kestelle-cookie-banner.kestelle-position-top.show {
    transform: translateX(-50%) translateY(0);
}

/* Position en bas à gauche */
#kestelle-cookie-banner.kestelle-position-bottom-left {
    bottom: 20px;
    left: 20px;
    transform: translateX(-100px);
}

#kestelle-cookie-banner.kestelle-position-bottom-left.show {
    transform: translateX(0);
}

/* Position en bas à droite */
#kestelle-cookie-banner.kestelle-position-bottom-right {
    bottom: 20px;
    right: 20px;
    left: auto;
    transform: translateX(100px);
}

#kestelle-cookie-banner.kestelle-position-bottom-right.show {
    transform: translateX(0);
}

/* Position en haut à gauche */
#kestelle-cookie-banner.kestelle-position-top-left {
    top: 20px;
    left: 20px;
    transform: translateX(-100px);
}

#kestelle-cookie-banner.kestelle-position-top-left.show {
    transform: translateX(0);
}

/* Position en haut à droite */
#kestelle-cookie-banner.kestelle-position-top-right {
    top: 20px;
    right: 20px;
    left: auto;
    transform: translateX(100px);
}

#kestelle-cookie-banner.kestelle-position-top-right.show {
    transform: translateX(0);
}

/* Position à gauche (centré verticalement) */
#kestelle-cookie-banner.kestelle-position-left {
    top: 50%;
    left: 20px;
    transform: translateY(-50%) translateX(-100px);
}

#kestelle-cookie-banner.kestelle-position-left.show {
    transform: translateY(-50%) translateX(0);
}

/* Position à droite (centré verticalement) */
#kestelle-cookie-banner.kestelle-position-right {
    top: 50%;
    right: 20px;
    left: auto;
    transform: translateY(-50%) translateX(100px);
}

#kestelle-cookie-banner.kestelle-position-right.show {
    transform: translateY(-50%) translateX(0);
}

/* Position au centre de l'écran */
#kestelle-cookie-banner.kestelle-position-center {
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%) scale(0.8);
}

#kestelle-cookie-banner.kestelle-position-center.show {
    transform: translateX(-50%) translateY(-50%) scale(1);
}

/* Content */
.kestelle-cookie-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 25px;
}

.kestelle-cookie-icon {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}

.kestelle-cookie-icon svg {
    width: 100%;
    height: 100%;
    animation: cookieWave 3s ease-in-out infinite;
}

@keyframes cookieWave {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

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

.kestelle-cookie-title {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 5px;
    opacity: 0.9;
}

.kestelle-cookie-subtitle {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.kestelle-cookie-message {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 15px 0;
    opacity: 0.85;
}

.kestelle-cookie-provider {
    font-size: 12px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kestelle-cookie-provider strong {
    font-weight: 600;
}

/* Buttons */
.kestelle-cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.kestelle-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.kestelle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.kestelle-btn:active {
    transform: translateY(0);
}

.kestelle-btn-refuse {
    background-color: var(--btn-refuse-bg) !important;
    color: var(--btn-refuse-text) !important;
    border: none;
}

.kestelle-btn-choose {
    background-color: var(--btn-choose-bg) !important;
    color: var(--btn-choose-text) !important;
    border: 2px solid var(--btn-choose-border) !important;
}

.kestelle-btn-accept {
    background-color: var(--btn-accept-bg) !important;
    color: var(--btn-accept-text) !important;
    border: none;
}

/* Responsive */
@media (max-width: 768px) {
    #kestelle-cookie-banner {
        width: 95%;
        padding: 20px;
    }

    .kestelle-cookie-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .kestelle-cookie-icon {
        width: 80px;
        height: 80px;
    }

    .kestelle-cookie-subtitle {
        font-size: 24px;
    }

    .kestelle-cookie-buttons {
        flex-direction: column;
    }

    .kestelle-btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .kestelle-cookie-subtitle {
        font-size: 20px;
    }

    .kestelle-cookie-message {
        font-size: 13px;
    }
}

/* Backdrop overlay (optional) */
/* DÉSACTIVÉ - Enlevé pour éviter le fond sombre
#kestelle-cookie-banner::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}

#kestelle-cookie-banner.show::before {
    opacity: 1;
    visibility: visible;
}
*/

/* Remove grey background from body when banner is shown */
body.kestelle-cookie-active {
    background: transparent !important;
}

/* Modal de gestion des cookies */
.kestelle-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.kestelle-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.kestelle-modal-content {
    background-color: #ffffff;
    margin: 20px;
    padding: 0;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

.kestelle-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kestelle-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.kestelle-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

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

.kestelle-modal-intro {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 25px;
}

.kestelle-cookie-category {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.kestelle-cookie-category:hover {
    background-color: #f0f1f3;
}

.kestelle-category-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.kestelle-category-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.kestelle-category-info p {
    margin: 0 0 8px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

.kestelle-category-info small {
    font-size: 12px;
    color: #999;
}

/* Switch personnalisé */
.kestelle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

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

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

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

.kestelle-switch input:checked + .kestelle-slider {
    background-color: #4CAF50;
}

.kestelle-switch input:disabled + .kestelle-slider {
    background-color: #4CAF50 !important;
    opacity: 1;
    cursor: not-allowed;
}

.kestelle-switch input:disabled:checked + .kestelle-slider {
    background-color: #4CAF50 !important;
}

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

.kestelle-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.kestelle-modal-footer .kestelle-btn {
    min-width: 140px;
}

@media (max-width: 768px) {
    .kestelle-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }

    .kestelle-modal-header {
        padding: 20px;
    }

    .kestelle-modal-body {
        padding: 20px;
    }

    .kestelle-modal-footer {
        flex-direction: column;
        padding: 15px 20px;
    }

    .kestelle-modal-footer .kestelle-btn {
        width: 100%;
        min-width: auto;
    }

    .kestelle-category-header {
        flex-direction: row;
    }
}
