/* ===== VARIABLES ===== */
:root {
  --primary: #4361ee;
  --primary-dark: #3a0ca3;
  --primary-light: #4895ef;
  --secondary: #f72585;
  --accent: #4cc9f0;
  --success: #2ec4b6;
  --warning: #ff9f1c;
  --danger: #e71d36;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --gray-light: #e9ecef;
  
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  --box-shadow-lg: 0 15px 35px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.1rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1;
  padding: 2rem 0;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.logo span {
  color: var(--accent);
}

/* ===== NAVIGATION ===== */
nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  transition: var(--transition);
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
  text-align: center;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
  color: white;
}

.btn-sm {
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.btn-accent {
  background: var(--secondary);
  box-shadow: 0 4px 15px rgba(247, 37, 133, 0.3);
}

.btn-accent:hover {
  background: #e01a7b;
  box-shadow: 0 6px 20px rgba(247, 37, 133, 0.4);
}

.btn-success {
  background: var(--success);
  box-shadow: 0 4px 15px rgba(46, 196, 182, 0.3);
}

.btn-success:hover {
  background: #25a99a;
  box-shadow: 0 6px 20px rgba(46, 196, 182, 0.4);
}

.btn-warning {
  background: var(--warning);
  box-shadow: 0 4px 15px rgba(255, 159, 28, 0.3);
}

.btn-warning:hover {
  background: #e0860e;
  box-shadow: 0 6px 20px rgba(255, 159, 28, 0.4);
}

.btn-danger {
  background: var(--danger);
  box-shadow: 0 4px 15px rgba(231, 29, 54, 0.3);
}

.btn-danger:hover {
  background: #c81a2f;
  box-shadow: 0 6px 20px rgba(231, 29, 54, 0.4);
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-lg);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-light);
  background: linear-gradient(to right, var(--primary-light), var(--primary));
  color: white;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-light);
  background-color: var(--gray-light);
}

/* ===== FORMS ===== */
.form-container {
  max-width: 500px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ===== MESSAGES ===== */
.message {
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1.5rem;
  text-align: center;
}

.message.success {
  background: rgba(46, 196, 182, 0.15);
  color: #0a7ea6;
  border: 1px solid rgba(46, 196, 182, 0.3);
}

.message.error {
  background: rgba(231, 29, 54, 0.15);
  color: #c1121f;
  border: 1px solid rgba(231, 29, 54, 0.3);
}

.message.warning {
  background: rgba(255, 159, 28, 0.15);
  color: #cc8500;
  border: 1px solid rgba(255, 159, 28, 0.3);
}

/* ===== TABLES ===== */
.table-container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}

th {
  background-color: var(--primary-light);
  color: white;
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: var(--gray-light);
}

tr:hover {
  background-color: rgba(67, 97, 238, 0.05);
}

/* ===== HERO SECTION ===== */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 3rem;
  border-radius: var(--border-radius);
  background: white;
  box-shadow: var(--box-shadow);
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.hero p {
  font-size: 1.2rem;
  color: var(--gray);
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* ===== FEATURES ===== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-lg);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.feature-card h3 {
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

/* ===== GAME SPECIFIC STYLES ===== */
.game-container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.question-box {
  background: var(--gray-light);
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1.5rem;
}

.timer {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary);
  text-align: center;
  margin: 1rem 0;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.answer-option {
  padding: 1rem;
  background: white;
  border: 2px solid var(--gray-light);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.answer-option:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.answer-option.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== DASHBOARD ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  text-align: center;
}

.dashboard-card h3 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.dashboard-card .stat {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-item {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
}

.stat-item h4 {
  color: var(--gray);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.stat-item p {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

/* ===== ADMIN PANEL ===== */
.admin-panel {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.admin-panel header {
  border-radius: 0;
}

.admin-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-light);
}

.admin-nav a {
  padding: 1rem 1.5rem;
  color: var(--gray);
  border-bottom: 3px solid transparent;
  border-radius: 0;
}

.admin-nav a:hover {
  background: transparent;
  color: var(--primary);
  border-bottom-color: var(--primary);
  transform: none;
}

.admin-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ===== FOOTER ===== */
footer {
  background: var(--dark);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent);
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .admin-nav {
    flex-direction: column;
  }
  
  .answer-options {
    grid-template-columns: 1fr;
  }
}



/* Styles pour le mode tournoi */
.tournament-card {
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-blue);
}

.tournament-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.player-status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: var(--dark-green);
}

.status-offline {
    background-color: var(--accent-red);
}

.status-answering {
    background-color: var(--secondary-yellow);
    animation: pulse 1s infinite;
}

.players-list {
    max-height: 300px;
    overflow-y: auto;
}

.countdown-timer {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    color: var(--primary-blue);
    margin: 2rem 0;
}

.tournament-results {
    text-align: center;
    padding: 2rem;
}

.winner-trophy {
    font-size: 4rem;
    color: gold;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .countdown-timer {
        font-size: 2rem;
    }
    
    .winner-trophy {
        font-size: 3rem;
    }
}