/* Variables CSS modernes pour 2025 */
:root {
    --kc-blue: #00D4FF;
    --kc-accent: #7B68EE;
    --kc-success: #10B981;
    --kc-danger: #EF4444;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --gradient-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --widget-scale: 0.75;
}

/* Reset et configuration de base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100vh; overflow: hidden; font-family: 'Inter', 'Arial', sans-serif; color: white; }

/* Vidéo de fond plein écran */
.video-background { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2; overflow: hidden; }
.video-background video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* Overlay - MODIFIÉ pour rendre le fond 15% plus visible */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.32);
    z-index: -1;
}

/* Menu de contrôle */
.widget-menu { position: fixed; top: 0; left: 0; width: 80px; height: 80px; z-index: 1000; }
.menu-trigger-area { position: absolute; top: 0; left: 0; width: 80px; height: 80px; background: transparent; }
.menu-toggle { position: absolute; top: 20px; left: 20px; width: 50px; height: 50px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); opacity: 0; visibility: hidden; transform: scale(0.8) translateY(-10px); }
.widget-menu:hover .menu-toggle, .menu-toggle.active { opacity: 1; visibility: visible; transform: scale(1) translateY(0); }
.menu-toggle:hover { background: rgba(255, 255, 255, 0.15); border-color: var(--kc-blue); box-shadow: 0 6px 30px rgba(0, 212, 255, 0.3); transform: scale(1.05) translateY(0); }

/* MODIFIÉ: Icône menu simple sans animation */
.menu-icon-simple {
    width: 4px;
    height: 4px;
    background: var(--kc-blue);
    border-radius: 50%;
    position: relative;
}

.menu-icon-simple::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--kc-blue);
    border-radius: 50%;
    top: -8px;
    left: 0;
}

.menu-icon-simple::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--kc-blue);
    border-radius: 50%;
    top: 8px;
    left: 0;
}

/* MODIFIÉ: Menu positionné au centre de l'écran */
.menu-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.menu-content.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.menu-content h3 { color: var(--kc-blue); font-size: 1.2rem; font-weight: 700; margin-bottom: 25px; text-align: center; text-transform: uppercase; letter-spacing: 0.8px; }
.menu-section { margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.menu-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.menu-section-title { color: rgba(255, 255, 255, 0.7); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; padding-left: 4px; }
.menu-item { display: flex; align-items: center; margin-bottom: 12px; gap: 15px; }
.menu-label { font-size: 1rem; font-weight: 500; color: var(--kc-blue); flex: 1; }

/* Switch toggle */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.3); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 13px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px; background: white; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
input:checked + .slider { background: var(--kc-blue); border-color: var(--kc-blue); box-shadow: 0 0 15px rgba(0, 212, 255, 0.4); }
input:checked + .slider:before { transform: translateX(22px); }

/* Style du curseur de taille */
.menu-item-slider { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#size-value { font-size: 1rem; font-weight: 700; color: var(--kc-blue); }
.size-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; background: rgba(255, 255, 255, 0.15); border-radius: 4px; outline: none; transition: opacity 0.2s; }
.size-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: white; border-radius: 50%; cursor: pointer; box-shadow: 0 0 15px rgba(0, 212, 255, 0.4); transition: background 0.3s ease; }
.size-slider::-webkit-slider-thumb:hover { background: var(--kc-blue); }
.size-slider::-moz-range-thumb { width: 20px; height: 20px; background: white; border-radius: 50%; cursor: pointer; }

/* Bouton refresh simplifié */
.menu-action { display: flex; justify-content: center; }
.refresh-button { background: linear-gradient(135deg, var(--kc-blue), var(--kc-accent)); border: none; border-radius: 15px; padding: 12px 20px; color: white; font-size: 0.9rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3); position: relative; overflow: hidden; min-width: 140px; justify-content: center; }
.refresh-button:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5); }

/* Widgets */
.widget {
    position: fixed;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: clamp(15px, 2vw, 20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    width: clamp(220px, 22vw, 300px);
    height: auto;
    transform: scale(var(--widget-scale)); 
}
.widget.hidden { opacity: 0; visibility: hidden; transform: scale(calc(var(--widget-scale) * 0.9)); pointer-events: none; }
.widget:hover { border-color: rgba(0, 212, 255, 0.4); box-shadow: 0 12px 40px rgba(0, 212, 255, 0.2); }

/* Positionnement des widgets */
.live-matches { top: 50%; left: 30px; transform-origin: left center; transform: translateY(-50%) scale(var(--widget-scale)); }
.upcoming-matches { top: 30px; right: 30px; transform-origin: top right; }
.recent-results { bottom: 30px; right: 30px; transform-origin: bottom right; }

.live-matches.hidden { transform: translateY(-50%) scale(calc(var(--widget-scale) * 0.9)); }
.upcoming-matches.hidden { transform: scale(calc(var(--widget-scale) * 0.9)); }
.recent-results.hidden { transform: scale(calc(var(--widget-scale) * 0.9)); }

/* MODIFIÉ: Titres des widgets de la même couleur que "Settings" */
.widget h2 { 
    font-size: clamp(1.1rem, 1.5vw, 1.3rem); 
    color: var(--kc-blue);
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: relative;
    flex-shrink: 0;
}

.widget h2::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--kc-blue);
    border-radius: 1px;
}

.matches-container { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; padding-right: 5px; }
.matches-container::-webkit-scrollbar { width: 3px; }
.matches-container::-webkit-scrollbar-track { background: transparent; }
.matches-container::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--kc-blue), var(--kc-accent)); border-radius: 2px; }

.match-item { 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 12px; 
    padding: clamp(10px, 1.5vw, 16px); 
    margin-bottom: 8px; 
    transition: all .3s;
    position: relative;
    overflow: hidden;
}

.match-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.match-item:hover::before {
    opacity: 1;
}

.live-match { 
    background: rgba(0,212,255,0.1); 
    border: 1px solid rgba(0,212,255,0.3); 
    animation: modernPulse 3s ease-in-out infinite; 
}

@keyframes modernPulse { 
    50% { box-shadow: 0 6px 30px rgba(0,212,255,0.4); } 
}

.live-indicator { 
    position: absolute; 
    top: 8px; 
    right: 12px; 
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E); 
    color: white; 
    padding: 3px 8px; 
    border-radius: 12px; 
    font-size: clamp(0.6rem, 1vw, 0.7rem); 
    font-weight: 600; 
    text-transform: uppercase;
    animation: modernBlink 2s ease-in-out infinite;
}

@keyframes modernBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Styles complets pour le contenu des widgets */
.game-title {
    background: var(--gradient-accent);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.8px;
}

.live-score {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 700;
    margin: 12px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 8px;
}

.live-score .team {
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-size: clamp(0.8rem, 1.5vw, 1rem);
}

.live-score .score {
    color: var(--kc-blue);
    text-shadow: 0 2px 6px rgba(0, 212, 255, 0.3);
    font-weight: 800;
}

.match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.opponent {
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    max-width: 140px;
}

.match-date {
    color: #aaa;
    font-size: clamp(0.65rem, 0.9vw, 0.75rem);
}

.match-time {
    color: var(--kc-blue);
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: bold;
}

.result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    font-weight: bold;
}

.result.win .opponent::before {
    content: '✓';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: var(--kc-success);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 8px;
    line-height: 14px;
    margin-right: 6px;
    font-weight: bold;
}

.result.loss .opponent::before {
    content: '✗';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: var(--kc-danger);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 8px;
    line-height: 14px;
    margin-right: 6px;
    font-weight: bold;
}

.win { color: var(--kc-success); }
.loss { color: var(--kc-danger); }

.score {
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--kc-blue);
}

.update-indicator { 
    text-align: center; 
    font-size: clamp(0.55rem, 0.7vw, 0.6rem); 
    color: rgba(255,255,255,0.3); 
    margin-top: 8px; 
    padding: 4px 8px; 
    background: rgba(255,255,255,0.01); 
    border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.02); 
    font-weight: 400; 
    flex-shrink: 0; 
    font-style: italic; 
    transition: all .3s ease; 
    opacity: 0.6; 
}
.widget:hover .update-indicator { opacity: 1; }

/* Loader moderne */
.loader {
    text-align: center;
    padding: clamp(20px, 4vw, 30px);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.loader::before {
    content: '';
    width: clamp(24px, 4vw, 32px);
    height: clamp(24px, 4vw, 32px);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-top: 2px solid var(--kc-blue);
    border-radius: 50%;
    animation: modernSpin 1s linear infinite;
    margin-bottom: 15px;
}

.loader::after {
    content: "Chargement...";
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.7rem, 1vw, 0.8rem);
}

@keyframes modernSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages d'erreur et vides */
.error-message, .no-match {
    text-align: center;
    padding: clamp(15px, 3vw, 20px);
    border-radius: 10px;
    font-size: clamp(0.75rem, 1vw, 0.85rem);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 60px;
}

.error-message {
    color: var(--kc-danger);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.no-match {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Media queries */
@media (max-width: 1200px) {
    .widget { width: clamp(200px, 20vw, 250px); }
    .live-matches { left: 20px; }
    .upcoming-matches, .recent-results { right: 20px; }
}

@media (max-width: 768px) {
    body { --widget-scale: 0.7; }
    .widget { padding: 10px; border-radius: 15px; }
    .live-matches, .upcoming-matches, .recent-results { position: static; transform: none !important; width: 95%; margin: 10px auto; height: auto; max-height: 35vh; }
    body { overflow-y: auto; }
    .widget-menu { top: 10px; left: 10px; }
    .menu-toggle { top: 0; left: 0; }
    .menu-content { width: 90%; max-width: 280px; }
}
