/* ===================================
   🎨 BABYFOOT TOURNAMENT - CSS MODERNE
   =================================== */

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.4); }
  50% { box-shadow: 0 0 30px rgba(255, 107, 107, 0.8); }
}

/* ============ RESET & BASE ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body { 
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-attachment: fixed;
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  margin: 0; 
  padding: 20px;
  min-height: 100vh;
  color: #2c3e50;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============ CONTAINER ============ */
.container { 
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.6s ease-out;
}

/* ============ NAVIGATION ============ */
nav { 
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  padding: 18px 30px;
  margin-bottom: 40px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.7s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

nav a { 
  color: white;
  text-decoration: none;
  margin: 5px 10px;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
}

nav a:hover::before {
  left: 100%;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3 {
  color: #1e3c72;
  margin-bottom: 20px;
  animation: fadeIn 0.8s ease-out;
  font-weight: 700;
}

h1 { 
  font-size: 2.5rem; 
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 { 
  font-size: 2rem; 
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
  display: inline-block;
}

h3 { 
  font-size: 1.5rem; 
  color: #2c3e50;
}

/* ============ TABLES ============ */
table { 
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.9s ease-out;
  background: white;
}

th, td { 
  padding: 16px 20px;
  text-align: left;
}

th { 
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  position: sticky;
  top: 0;
  z-index: 10;
}

tbody tr {
  transition: all 0.3s ease;
  border-bottom: 1px solid #ecf0f1;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: #f8f9fa;
}

tbody tr:hover {
  background: linear-gradient(90deg, #e3f2fd 0%, #bbdefb 100%);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

tbody tr:first-child td {
  font-weight: 700;
  color: #ff6b6b;
  font-size: 1.1rem;
}

tbody tr:first-child {
  background: linear-gradient(90deg, #fff5f5 0%, #ffe0e0 100%);
}

/* ============ FORMS ============ */
.form-group { 
  margin-bottom: 25px;
  animation: fadeIn 0.6s ease-out;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

input, select, textarea { 
  width: 100%;
  padding: 14px 18px;
  margin-top: 5px;
  border: 2px solid #e1e8ed;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-family: inherit;
  background: white;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

input::placeholder {
  color: #bdc3c7;
}

/* ============ BUTTONS ============ */
button { 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 30px;
  cursor: pointer;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::before {
  width: 300px;
  height: 300px;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

button:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button[type="submit"] {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

button[type="submit"]:hover {
  box-shadow: 0 10px 30px rgba(39, 174, 96, 0.5);
}

/* Boutons de danger */
.btn-danger, button.delete {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-danger:hover, button.delete:hover {
  box-shadow: 0 10px 30px rgba(231, 76, 60, 0.5);
}

/* Boutons secondaires */
.btn-secondary {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

/* ============ ALERTS & MESSAGES ============ */
.error, .alert-danger { 
  color: #c0392b;
  background: linear-gradient(135deg, #fadbd8 0%, #f8d7da 100%);
  padding: 16px 20px;
  border-radius: 10px;
  border-left: 5px solid #e74c3c;
  animation: fadeIn 0.4s ease-out;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.success, .alert-success { 
  color: #27ae60;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  padding: 16px 20px;
  border-radius: 10px;
  border-left: 5px solid #27ae60;
  animation: fadeIn 0.4s ease-out;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.info, .alert-info {
  color: #2980b9;
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  padding: 16px 20px;
  border-radius: 10px;
  border-left: 5px solid #3498db;
  animation: fadeIn 0.4s ease-out;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

/* ============ CARDS ============ */
.card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 25px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeIn 0.7s ease-out;
  border: 1px solid #ecf0f1;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
  border-color: #667eea;
}

/* ============ BADGES & STATUS ============ */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
}

.badge-success {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
}

.badge-info {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
}

.badge-warning {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: white;
}

/* Statuts de tournois */
.status-open { 
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: white; 
  padding: 6px 12px; 
  border-radius: 20px; 
  font-weight: 600;
  display: inline-block;
  font-size: 0.85rem;
}

.status-in_progress { 
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: white; 
  padding: 6px 12px; 
  border-radius: 20px; 
  font-weight: 600;
  display: inline-block;
  font-size: 0.85rem;
  animation: pulse 2s ease infinite;
}

.status-finished { 
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  color: white; 
  padding: 6px 12px; 
  border-radius: 20px; 
  font-weight: 600;
  display: inline-block;
  font-size: 0.85rem;
}

/* ============ LAYOUT HELPERS ============ */
.flex-container {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
}

.flex-item {
  flex: 1;
  min-width: 300px;
}

/* ============ MODAL ============ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.4s ease-out;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 20px;
    border-radius: 15px;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }
  
  nav {
    padding: 15px;
    flex-direction: column;
  }

  nav a {
    display: block;
    margin: 5px 0;
    text-align: center;
  }
  
  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 10px 12px;
  }
  
  table button {
    display: block;
    width: 100%;
    margin: 5px 0;
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .flex-container {
    flex-direction: column;
  }

  .flex-item {
    min-width: 100%;
  }

  button {
    width: 100%;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }

  .container {
    padding: 15px;
  }

  input, select, textarea {
    padding: 12px 15px;
    font-size: 0.95rem;
  }
}
