/* Sortable Ghost Class */
.sortable-ghost { opacity: 0.4; background: rgba(255,255,255,0.1); border-style: dashed !important; }

:root {
    --primary: #f97316;
    --secondary: #ec4899;
    --bg-body: #000000;
    --text-main: #ffffff;
    --font-main: 'Outfit', sans-serif;
    
    /* Variables pour le thème Admin */
    --glass-bg: #1b2335;
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-bg-hover: rgba(255, 255, 255, 0.2);
    --input-text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --faint-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --widget-radius: 24px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    z-index: -1;
    pointer-events: none;
}

.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-social {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px;
    border-radius: var(--widget-radius);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}
.btn-social:hover { transform: scale(1.02); }

.color-input-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.color-input-wrapper input[type="color"] {
    position: absolute;
    top: -5px; left: -5px; width: 120%; height: 120%;
    cursor: pointer;
    border: none;
}

.tabs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
}

.tab-btn {
    white-space: nowrap;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.admin-nav-btn {
    padding: 16px;
    border-radius: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    background: var(--faint-bg); /* Variable unifiée */
}
.admin-nav-btn:hover { opacity: 0.8; transform: scale(1.05); }
.admin-nav-btn.active {
    opacity: 1;
    background: var(--input-bg); /* Variable unifiée */
    color: var(--primary);
}

.editor-tab-btn {
    padding: 0.5rem 1rem; /* py-2 px-4 */
    border-radius: 9999px; /* rounded-full */
    font-size: 0.875rem; /* text-sm */
    font-weight: 700; /* font-bold */
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
}
.editor-tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}
.editor-tab-btn.active {
    background-color: white;
    color: #0f172a; /* slate-900 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.editor-tab-btn.active svg {
    color: var(--primary);
}

.admin-item-card {
    background: var(--faint-bg); /* Variable unifiée */
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}
.admin-item-card:hover {
    background: var(--input-bg); /* Variable unifiée */
    color: var(--input-text); /* Variable unifiée */
    border-left-color: var(--primary);
}

.input-inline {
    background: transparent;
    border: none;
    color: inherit;
    font-family: inherit;
    width: 100%;
    outline: none;
    padding: 2px 0;
}

::-webkit-scrollbar { display: none; }

/* EFFET VAGUES */
#wave-container {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 15vh; min-height: 100px; z-index: -1; pointer-events: none; display: none;
}
.waves { position: relative; width: 100%; height: 100%; margin-bottom: -7px; }
.parallax > use { animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite; }
.parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; fill: var(--primary); opacity: 0.7; }
.parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; fill: var(--secondary); opacity: 0.5; }
.parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; fill: var(--primary); opacity: 0.3; }
.parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; fill: var(--secondary); opacity: 1; }
@keyframes move-forever {
    0% { transform: translate3d(-90px,0,0); }
    100% { transform: translate3d(85px,0,0); }
}

/* EFFET SCANLINES (CYBER) */
#scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; display: none;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

/* SELECTEURS PERSONNALISÉS */
.selector-btn {
    background: var(--faint-bg); /* Variable unifiée */
    border: 1px solid rgba(255,255,255,0.1); padding: 10px; border-radius: 8px;
    text-align: left; cursor: pointer; transition: all 0.2s; font-size: 11px; display: flex; align-items: center; gap: 8px; 
    color: var(--text-muted); /* Variable unifiée */
}
.selector-btn:hover { 
    background: var(--input-bg); /* Variable unifiée */
    color: var(--input-text); /* Variable unifiée */
}
.selector-btn.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 2px 10px rgba(0,0,0,0.2); font-weight: bold; }

.custom-scrollbar::-webkit-scrollbar { width: 4px; display: block; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* Drawer / Modal */
#drawer-overlay {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}
#drawer-content {
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
#drawer-content.active {
    transform: translateY(0);
}
@media (min-width: 768px) {
    #drawer-content {
        transform: translate(-50%, 120%);
    }
    #drawer-content.active {
        transform: translate(-50%, 0);
    }
}

/* Drawer Loyalty (Mini-Wallet) */
#drawer-loyalty {
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
#drawer-loyalty.active {
    transform: translateY(0);
}
@media (min-width: 768px) {
    #drawer-loyalty { transform: translate(-50%, 120%); }
    #drawer-loyalty.active { transform: translate(-50%, 0); }
}

/* Drawer Profile */
#drawer-profile {
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
#drawer-profile.active {
    transform: translateY(0);
}
@media (min-width: 768px) {
    #drawer-profile { transform: translate(-50%, 120%); }
    #drawer-profile.active { transform: translate(-50%, 0); }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    gap: 6px;
}
.status-open { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.status-closed { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.status-vacation { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }

.pulse-dot {
    width: 6px; height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.5; } 100% { transform: scale(1); opacity: 1; } }

@keyframes star-pop {
    0% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(0); opacity: 0; }
    60% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.4); opacity: 1; }
    100% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(1); opacity: 1; }
}
.star-anim {
    opacity: 0;
    animation: star-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ACCORDION / FAQ */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}
.accordion-content.active {
    opacity: 1;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.accordion-icon { transition: transform 0.3s ease; }
.accordion-btn[aria-expanded="true"] .accordion-icon { transform: rotate(180deg); }

/* PRICING TABLE */
.pricing-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--widget-radius);
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.pricing-card:hover { transform: translateY(-3px); background: var(--input-bg-hover); }
.pricing-price { font-size: 1.25rem; font-weight: 900; color: var(--primary); margin: 0.5rem 0; }
.pricing-features { text-align: left; font-size: 0.85rem; opacity: 0.8; line-height: 1.4; }
.pricing-check { color: #4ade80; margin-right: 4px; font-size: 0.8em; }

/* STICKY VIDEO PLAYER */
#video-container {
    position: fixed; bottom: 20px; right: 20px; width: 280px; z-index: 999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none; flex-direction: column;
    overflow: hidden; pointer-events: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
}
#video-container.active { display: flex; animation: fadeInUp 0.5s; }

/* Mode Cinéma */
#video-container.cinema {
    width: 90vw; max-width: 1000px;
    top: 50%; left: 50%; bottom: auto; right: auto;
    transform: translate(-50%, -50%);
}

/* Mode Minimized (Audio Only) */
#video-container.minimized {
    width: 220px; height: auto;
    bottom: 20px; right: 20px;
    top: auto; left: auto; transform: none;
}
#video-container.minimized #video-wrapper { display: none; }
#video-container.minimized .video-controls { border-bottom: none; background: rgba(0,0,0,0.8); }
#video-container.minimized #minimized-text { display: block; }

.video-controls {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; background: black; }
#video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* VIDEO THUMBNAIL CARD */
.video-thumbnail-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #000;
    border-radius: var(--widget-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}
.video-thumbnail-card:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.video-play-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center; transition: background 0.3s;
}
.video-thumbnail-card:hover .video-play-overlay { background: rgba(0,0,0,0.1); }
.video-play-icon {
    width: 48px; height: 48px; background: rgba(255,255,255,0.2); backdrop-filter: blur(4px);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 24px; transition: transform 0.3s;
}
.video-thumbnail-card:hover .video-play-icon { transform: scale(1.1); background: var(--primary); }
.video-title-badge {
    position: absolute; bottom: 10px; left: 10px; right: 10px;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    padding: 8px 12px; border-radius: 8px; color: white;
    font-size: 12px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* TWITCH BADGES */
.twitch-badge {
    position: absolute; top: 10px; right: 10px;
    padding: 4px 8px; border-radius: 4px;
    font-size: 10px; font-weight: 900; text-transform: uppercase; z-index: 10;
}
.twitch-live { background: #ef4444; color: white; box-shadow: 0 0 10px #ef4444; animation: pulse 2s infinite; }
.twitch-offline { background: rgba(0,0,0,0.6); color: #9ca3af; backdrop-filter: blur(4px); }

/* SAVE INDICATOR */
#save-notification {
    position: fixed; bottom: 20px; left: 20px; z-index: 9999;
    transition: opacity 0.5s ease; pointer-events: none;
}

/* PROFILE DROPDOWN */
.profile-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 10px;
    background: #1b2335; /* Fond uni bleu nuit, comme demandé. */
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px;
    padding: 6px; min-width: 200px; display: none; flex-direction: column; gap: 2px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); z-index: 100; transform-origin: top right;
}
.profile-dropdown.active { display: flex; animation: dropdownEnter 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes dropdownEnter { from { opacity: 0; transform: scale(0.9) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.profile-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    border-radius: 12px; color: white; font-size: 11px; font-weight: 700;
    cursor: pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 1px;
}
.profile-item:hover { background: rgba(255,255,255,0.1); transform: translateX(2px); }
.profile-item svg { width: 18px; height: 18px; opacity: 0.7; }
.profile-item:hover svg { opacity: 1; }

.admin-widget-item { touch-action: none; }

/* Admin Panel Theming Overrides */
#view-admin .glass h3, 
#view-admin .glass .font-bold.text-white {
    color: var(--input-text) !important;
}
#view-admin .glass label, 
#view-admin .glass .opacity-70, 
#view-admin .glass .opacity-50 {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}
#view-admin .glass .text-orange-400 { color: var(--primary) !important; }
#view-admin .glass input[type="text"],
#view-admin .glass select,
#view-admin .glass button.bg-white\/10,
#view-admin .glass .bg-white\/5 {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
}
#view-admin .glass input[type="text"]::placeholder { color: var(--text-muted) !important; opacity: 1 !important; }
#view-admin .glass button.hover\:bg-white\/20:hover { background-color: var(--input-bg-hover) !important; }
#view-admin .glass input[type="file"] { color: var(--text-muted) !important; }
#view-admin .glass .file\:bg-white\/10::-webkit-file-upload-button,
#view-admin .glass .file\:bg-white\/10::file-selector-button { background-color: var(--input-bg) !important; color: var(--input-text) !important; }
#view-admin .glass .hover\:file\:bg-white\/20:hover::-webkit-file-upload-button,
#view-admin .glass .hover\:file\:bg-white\/20:hover::file-selector-button { background-color: var(--input-bg-hover) !important; }

.widget-card {
    border-radius: var(--widget-radius);
}

.menu-card {
    border-radius: var(--widget-radius);
}

/* TICKER */
.ticker-container {
    width: 100%;
    overflow: hidden;
    padding: 1rem 0; /* Vertical padding only */
    border-radius: var(--widget-radius);
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    /* Fade out effect (Masque dégradé) */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    border: none;
}
.ticker-wrapper {
    display: flex;
    width: max-content;
    animation-name: ticker-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
.ticker-track {
    flex-shrink: 0;
    padding-right: 0;
    white-space: nowrap;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    color: var(--primary);
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* OVERLAY: CINEMA */
.film-grain {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.scratches {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 41; opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='lines'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.01 0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeContrast border='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23lines)'/%3E%3C/svg%3E");
    animation: jitter 0.5s steps(4) infinite;
}

.dust {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 42; opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='dust'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.99' numOctaves='1'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000 -50'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23dust)'/%3E%3C/svg%3E");
    animation: flicker 2s steps(2) infinite;
}

.vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 43;
    background: radial-gradient(circle, transparent 10%, rgba(0,0,0,0.3) 100%);
}

@keyframes jitter {
    0% { transform: translateX(0); opacity: 0.08; }
    25% { transform: translateX(-5px) scaleX(-1); opacity: 0.05; }
    50% { transform: translateX(10px); opacity: 0.1; }
    75% { transform: translateX(-8px); opacity: 0.06; }
    100% { transform: translateX(2px); opacity: 0.08; }
}

@keyframes flicker {
    0% { opacity: 0.03; }
    50% { opacity: 0.08; }
    100% { opacity: 0.04; }
}

/* OVERLAY: CRT */
.crt-lines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 3px, 3px 100%;
}

.crt-vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 41;
    background: radial-gradient(circle, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 100%);
}

/* OVERLAY: GLITCH (HACKER STYLE) */
.glitch-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1;
}

/* 1. Matrix Background */
.glitch-matrix {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.1;
    background: linear-gradient(rgba(0, 255, 65, 0.1) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 255, 65, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 2. Scan Line */
.glitch-scan {
    position: absolute; top: 0; left: 0; width: 100%; height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 65, 0.1), transparent);
    animation: scan 4s linear infinite;
}

/* 3. Noise */
.glitch-noise {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* TEXT GLITCH EFFECT */
.text-glitch {
    position: relative;
    animation: text-glitch-anim 3s infinite;
}

@keyframes text-glitch-anim {
    0%, 90%, 100% { 
        text-shadow: 2px 2px #ff0055, -2px -2px #00d4ff; 
    }
    92% { 
        text-shadow: 5px -2px #00ff41, -5px 2px #ff0055; 
        transform: translate(2px, 0);
    }
    95% { 
        text-shadow: -3px 3px #00d4ff, 3px -3px #00ff41; 
        transform: translate(-2px, 0);
    }
}

/* OVERLAY: PARCHEMIN */
.parchemin-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40;
    /* Texture papier froissé générée via SVG */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.03' numOctaves='5'/%3E%3CfeDiffuseLighting lighting-color='%23f0e6d2' surfaceScale='2'%3E%3CfeDistantLight azimuth='45' elevation='60'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)'/%3E%3C/svg%3E");
    opacity: 0.3;
    mix-blend-mode: overlay;
}

.parchemin-grain {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 41; opacity: 0.12;
    /* Grain fin */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    filter: sepia(100%);
}

.parchemin-tint {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 39;
    backdrop-filter: sepia(0.4) brightness(0.95);
    -webkit-backdrop-filter: sepia(0.4) brightness(0.95);
}

/* OVERLAY: LIGNE */
.ligne-grain {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.ligne-scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 41;
    background: linear-gradient(to bottom, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.02) 50%);
    background-size: 100% 4px;
}

/* --- MODE ÉDITION (WYSIWYG) --- */

.editable-widget {
    position: relative;
    border: 2px dashed transparent;
    border-radius: var(--widget-radius);
    transition: all 0.2s ease;
    cursor: pointer;
}

.editable-widget:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.editable-widget.selected {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    z-index: 10;
}

/* Barre d'outils flottante au dessus du widget sélectionné */
.widget-toolbar {
    position: absolute;
    top: -40px;
    right: 0;
    background: #0f172a; /* Fond bleu nuit, comme la sidebar. */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Bordure pour la visibilité. */
    border-radius: 8px;
    padding: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100; /* Augmenté pour être sûr d'être au-dessus */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.editable-widget.selected .widget-toolbar {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* VISIBILITÉ RENFORCÉE EN MODE ÉDITION (MOBILE) */
body.edit-mode .editable-widget {
    border-color: var(--text-muted); /* Liseré pointillé adapté au thème */
}

body.edit-mode .add-block-separator {
    opacity: 0.6; /* Les boutons "+" sont visibles par défaut */
}

/* Puce d'ajout (+) entre les blocs */
.add-block-separator {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    margin: 4px 0;
}
.add-block-separator:hover { opacity: 1; }
.add-block-btn {
    background: var(--primary); color: white; width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}
.add-block-btn:hover { transform: scale(1.2); }

/* Animation Drawer Mobile */
@media (max-width: 768px) {
    .widget-toolbar { padding: 8px; gap: 8px; top: -50px; } /* Plus gros sur mobile */
}

/* --- WIDGET VOTE / SONDAGE --- */
.vote-container {
    position: relative;
    overflow: hidden;
}

.vote-option-bg {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    height: 48px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}
.vote-option-bg:hover { border-color: var(--primary); }

.vote-bar-fill {
    position: absolute; top: 0; left: 0; height: 100%;
    background: var(--primary);
    opacity: 0.6;
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.vote-content {
    position: relative; z-index: 2;
    display: flex; justify-content: space-between; align-items: center;
    height: 100%; padding: 0 16px;
    font-size: 13px; font-weight: 600;
}

.vote-boost-btn {
    background: var(--secondary);
    color: white; font-size: 9px; font-weight: bold;
    padding: 0 10px; border-radius: 8px; height: 48px;
    display: flex; align-items: center; gap: 4px;
    transition: transform 0.1s;
}
.vote-boost-btn:active { transform: scale(0.95); }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}
.shake { animation: shake 0.3s ease-in-out; }

/* --- WIDGET CARROUSEL --- */
.carousel-container {
    border-radius: var(--widget-radius);
    overflow: hidden;
    position: relative;
}
.carousel-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
}
.carousel-slider::-webkit-scrollbar { display: none; }
.carousel-item {
    flex: 0 0 100%;
    scroll-snap-align: center;
    aspect-ratio: 16/9;
    position: relative;
}
.carousel-item img { width: 100%; height: 100%; object-fit: cover; }

/* NAVIGATION CARROUSEL */
.carousel-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,0.5); color: white; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; backdrop-filter: blur(4px);
    transition: background 0.2s, opacity 0.2s; opacity: 0;
}
.carousel-container:hover .carousel-nav-btn { opacity: 1; }
.carousel-nav-btn:hover { background: rgba(0,0,0,0.8); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-caption {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 20px 16px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white; font-size: 12px; font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* --- LIGHTBOX (ZOOM IMAGE) --- */
#lightbox-modal {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.95); backdrop-filter: blur(10px);
    display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
#lightbox-modal.active { opacity: 1; }
.lightbox-content {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    max-width: 95vw; max-height: 90vh; position: relative;
}
#lightbox-img {
    max-width: 100%; max-height: 80vh; object-fit: contain;
    border-radius: 8px; box-shadow: 0 0 50px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); color: white;
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; border: none; z-index: 10;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); transform: translateY(-50%) scale(1.1); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-caption {
    margin-top: 15px;
    text-align: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 20;
}

/* --- AUTH MODAL OVERRIDE (HUB.HTML) --- */
/* Force a consistent style for auth modals, ignoring the user's theme. */
#modal-login, #modal-register, #modal-forgot, #modal-reset {
    font-family: 'Outfit', sans-serif !important;
}

/* The main box of the modal */
#modal-login > div, 
#modal-register > div, 
#modal-forgot > div, 
#modal-reset > div {
    background-color: #0f172a !important; /* slate-900 */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Titles */
#modal-login h2, 
#modal-register h2, 
#modal-forgot h2, 
#modal-reset h2 {
    color: #ffffff !important;
}

/* Paragraphs, labels, other text */
#modal-login p, #modal-login label, #modal-login span,
#modal-register p, #modal-register label, #modal-register span,
#modal-forgot p, #modal-forgot label, #modal-forgot span,
#modal-reset p, #modal-reset label, #modal-reset span {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Inputs */
#modal-login input,
#modal-register input,
#modal-forgot input,
#modal-reset input {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Submit buttons */
#modal-login button[type="submit"],
#modal-register button[type="submit"],
#modal-forgot button[type="submit"],
#modal-reset button[type="submit"] {
    background-color: #f97316 !important; /* orange-500 */
    color: #ffffff !important;
}

/* Links inside modals (e.g., "Créer un compte") */
#modal-login button:not([type="submit"]),
#modal-register button:not([type="submit"]),
#modal-forgot button:not([type="submit"]),
#modal-reset button:not([type="submit"]) {
    color: #f97316 !important; /* orange-500 */
    background-color: transparent !important; /* Ensure no background is inherited */
}

/* --- ROUE DE LA FORTUNE (WHEEL) --- */
.wheel-game-container {
    background: var(--bg-body);
    border: 1px solid #333;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
}
.wheel-wrapper {
    position: relative;
    width: 280px; height: 280px;
    margin: 20px auto;
}
@media (min-width: 400px) {
    .wheel-wrapper { width: 320px; height: 320px; }
}
.wheel-pointer {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 40px; z-index: 100;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}
#wheel-canvas {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 8px solid var(--primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    transition: transform 6s cubic-bezier(0.2, 0, 0.2, 1);
}
.wheel-center {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    background: radial-gradient(circle, #f3d9a2, #c5a059);
    border-radius: 50%; border: 4px solid #1a1a1a;
    z-index: 10; box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.btn-spin {
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    color: #000; font-weight: 900; text-transform: uppercase; letter-spacing: 2px;
    padding: 20px; width: 100%; border-radius: 12px;
    transition: all 0.3s ease; cursor: pointer; border: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4); display: block; margin-top: 20px;
}
.btn-spin:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.1); }
.btn-spin:disabled { background: #444; color: #777; box-shadow: none; cursor: not-allowed; }
.stat-card { background: var(--glass-bg); padding: 12px; border-radius: 12px; border: 1px solid var(--glass-border); }
.gold-text { color: var(--primary); }
@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.win-active { animation: celebrate 0.5s ease infinite; color: var(--primary) !important; }

/* --- AVIS GOOGLE (REVIEW) --- */
.review-widget-container {
    background: var(--bg-body);
    border: 1px solid #333;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
}

/* --- EFFET FLIP 3D (LOGO) --- */
.perspective-1000 { perspective: 1000px; }
.transform-style-3d { transform-style: preserve-3d; -webkit-transform-style: preserve-3d; }
.backface-hidden { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.rotate-y-180 { transform: rotateY(180deg); }
.flip-active { transform: rotateY(180deg) scale(1.8) !important; z-index: 50; }
