/* =========================================
   STYLE.CSS - SEB PROJECT MASTER
   ========================================= */

:root {
    --bg-color: #0f172a;       /* Bleu nuit */
    --primary: #6366f1;        /* Indigo */
    --accent: #ec4899;         /* Rose */
    --glass: rgba(30, 41, 59, 0.7); /* Verre fumé */
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Poppins', sans-serif; text-decoration: none;
}

/* FOND & STRUCTURE */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 25%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column; /* Pour le footer en bas */
}

/* NAVIGATION */
.glass-nav {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px);
    padding: 12px 40px; border-radius: 50px; border: 1px solid var(--glass-border);
    display: flex; align-items: center; gap: 40px; z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: max-content;
}
.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: 1px; color: white; white-space: nowrap; }
.logo span { color: var(--primary); }
.nav-links { list-style: none; display: flex; gap: 30px; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active-page { color: white; text-shadow: 0 0 10px rgba(255,255,255,0.4); }

/* CONTENEUR */
.container {
    max-width: 1200px; margin: 0 auto;
    padding: 140px 20px 40px; 
    flex: 1; 
    width: 100%;
    animation: fadeIn 0.8s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

h1, h2, h3 { color: white; }
h2 {
    font-size: 2.5rem; margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* BOUTONS */
.btn-primary {
    background: var(--primary); color: white;
    padding: 12px 25px; border-radius: 8px; border: none;
    font-weight: 600; cursor: pointer; transition: 0.3s; display: inline-block;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3); font-size: 0.9rem;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5); }

/* ACCUEIL */
.hero-layout { display: flex; align-items: center; justify-content: space-between; min-height: 60vh; margin-top: 50px;}
.hero-content h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 20px; }
.hero-content p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 30px; max-width: 500px; line-height: 1.6; }

/* PROJETS */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.project-card {
    background: var(--glass); border: 1px solid var(--glass-border);
    padding: 30px; border-radius: 20px; transition: 0.3s;
    backdrop-filter: blur(10px); display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-10px); border-color: var(--primary); background: rgba(255,255,255,0.08); }
.project-card h3 { color: var(--primary); margin-bottom: 10px; }
.project-card p { flex-grow: 1; margin-bottom: 20px; color: var(--text-muted); }
.tags { margin-bottom: 15px; }
.tags span { font-size: 0.75rem; background: rgba(0,0,0,0.3); padding: 5px 10px; border-radius: 5px; margin-right: 5px; color: #ccc; }

/* IA */
.ai-interface {
    max-width: 900px; margin: 0 auto; height: 70vh;
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: 24px; display: flex; flex-direction: column; overflow: hidden;
    backdrop-filter: blur(15px); box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.ai-header { padding: 20px; border-bottom: 1px solid var(--glass-border); background: rgba(0,0,0,0.2); text-align: center; }
.mode-selector { display: flex; justify-content: center; gap: 10px; margin-top: 15px; flex-wrap: wrap;}
.mode-btn { 
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); 
    color: var(--text-muted); padding: 8px 16px; border-radius: 20px; cursor: pointer; transition: 0.3s; 
}
.mode-btn:hover, .mode-btn.active-mode { background: var(--primary); color: white; border-color: var(--primary); }
.chat-box { flex: 1; padding: 25px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.msg { padding: 12px 18px; border-radius: 15px; max-width: 85%; font-size: 0.95rem; line-height: 1.5; }
.msg.bot { background: rgba(255,255,255,0.08); align-self: flex-start; border-bottom-left-radius: 2px; }
.msg.user { background: var(--primary); align-self: flex-end; border-bottom-right-radius: 2px; }
.input-area { padding: 20px; background: rgba(0,0,0,0.2); display: flex; gap: 10px; }
#user-input { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); padding: 12px; border-radius: 12px; color: white; outline: none; }

/* JEU TETRIS & LEADERBOARD */
.game-container { display: flex; justify-content: center; align-items: center; min-height: 60vh; }
.game-ui {
    display: flex; gap: 40px; padding: 40px;
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: 24px; backdrop-filter: blur(15px); align-items: flex-start; width: 100%; max-width: 800px;
}
.game-info { width: 100%; flex: 1; }
.score-board h3 { font-size: 2.5rem; color: var(--accent); margin-bottom: 5px; }
canvas { border: 2px solid #333; border-radius: 4px; box-shadow: 0 0 40px rgba(0,0,0,0.5); background: #000; }

/* Pseudo Input */
.player-input-zone { margin-bottom: 20px; width: 100%; }
.player-input-zone label { display: block; color: var(--text-muted); margin-bottom: 5px; font-size: 0.8rem; }
.player-input-zone input {
    width: 100%; padding: 10px; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
    border-radius: 8px; color: white; font-weight: bold; outline: none; text-align: center;
}
.player-input-zone input:focus { border-color: var(--primary); }

/* Leaderboard Scrollable Top 20 */
.leaderboard-section { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--glass-border); width: 100%; }
.leaderboard-section h4 { color: var(--primary); margin-bottom: 10px; font-size: 1rem; text-align: center; }

.scrollable-list { max-height: 250px; overflow-y: auto; padding-right: 5px; list-style: none; padding-left: 0; }
.scrollable-list::-webkit-scrollbar { width: 6px; }
.scrollable-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 3px; }
.scrollable-list::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.scrollable-list li {
    display: flex; justify-content: space-between; padding: 8px 0;
    font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.scrollable-list li span:nth-child(1) { color: var(--text-muted); }
.scrollable-list li span:nth-child(2) { color: var(--accent); font-weight: bold; }

/* Timer Style */
#timer { font-family: monospace; font-size: 2rem; letter-spacing: 2px; text-shadow: 0 0 10px rgba(74, 222, 128, 0.4); color: #4ade80; margin-bottom: 15px; }

/* FOOTER */
footer {
    text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.9rem;
    margin-top: auto; border-top: 1px solid var(--glass-border); background: rgba(15, 23, 42, 0.4);
}
.social-links { margin-top: 15px; display: flex; justify-content: center; gap: 20px; }
.social-links a { color: var(--primary); font-weight: 600; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .glass-nav { width: 90%; padding: 15px; flex-direction: column; gap: 15px; border-radius: 20px; }
    .nav-links { gap: 15px; flex-wrap: wrap; justify-content: center; }
    .hero-layout { flex-direction: column; text-align: center; margin-top: 20px; }
    .hero-visual { display: none; }
    .ai-interface, .game-ui { height: auto; padding: 15px; flex-direction: column; }
    .game-ui { align-items: center; gap: 20px; }
    .projects-grid { grid-template-columns: 1fr; }
    .container { padding-top: 180px; }
}