/* ==========================================
   SecuLab CTF - Design Theme (Hacker Style)
   ========================================== */

:root {
  /* Couleurs principales */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-hover: #252b3d;

  /* Couleurs d'accent */
  --accent-cyan: #00f5ff;
  --accent-green: #00ff88;
  --accent-purple: #a855f7;
  --accent-red: #ff4757;
  --accent-orange: #ff9f43;
  --accent-blue: #3b82f6;

  /* Texte */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Autres */
  --border-color: #2d3748;
  --shadow-glow: 0 0 20px rgba(0, 245, 255, 0.3);

  /* Fonts */
  --font-mono: "JetBrains Mono", monospace;
  --font-sans: "Inter", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==========================================
   Navigation
   ========================================== */

.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-brand a {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-decoration: none;
  text-shadow: var(--shadow-glow);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-hover);
  color: var(--accent-cyan);
}

.btn-logout {
  background: var(--accent-red) !important;
  color: white !important;
}

/* ==========================================
   Main Content
   ========================================== */

.main-content {
  min-height: calc(100vh - 140px);
  padding: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ==========================================
   Hero Section
   ========================================== */

.hero-section {
  text-align: center;
  padding: 3rem 0;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.neon-text {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 5px var(--accent-cyan));
  }
  to {
    filter: drop-shadow(0 0 20px var(--accent-cyan));
  }
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-description {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================
   Modules Grid
   ========================================== */

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.module-preview {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.module-preview::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.module-preview:hover {
  transform: translateY(-5px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.module-preview:hover::before {
  transform: scaleX(1);
}

.module-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.module-preview h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.vuln-type {
  display: inline-block;
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.module-preview p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================
   Module Cards
   ========================================== */

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.module-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.module-header h1 {
  font-size: 2rem;
}

/* ==========================================
   Badges
   ========================================== */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-danger {
  background: rgba(255, 71, 87, 0.2);
  color: var(--accent-red);
}
.badge-warning {
  background: rgba(255, 159, 67, 0.2);
  color: var(--accent-orange);
}
.badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
}
.badge-critical {
  background: rgba(255, 71, 87, 0.3);
  color: #ff6b7a;
  border: 1px solid var(--accent-red);
}
.badge-admin {
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
}

/* ==========================================
   Hints Section
   ========================================== */

.module-hint {
  background: rgba(0, 245, 255, 0.05);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.module-hint h3 {
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.module-hint ol,
.module-hint ul {
  margin-left: 1.5rem;
}

.module-hint li {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.module-hint details {
  margin-top: 1rem;
}

.module-hint summary {
  cursor: pointer;
  color: var(--accent-purple);
  font-weight: 600;
}

.module-hint details[open] summary {
  margin-bottom: 0.75rem;
}

.module-hint code {
  background: var(--bg-secondary);
  color: var(--accent-green);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ==========================================
   Forms
   ========================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: var(--bg-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 245, 255, 0.4);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-warning {
  background: var(--accent-orange);
  color: var(--bg-primary);
}

.btn-info {
  background: var(--accent-blue);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================
   Alerts
   ========================================== */

.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--accent-green);
}

.alert-danger {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.3);
  color: var(--accent-red);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
}

/* ==========================================
   Status Boxes
   ========================================== */

.status-box {
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.status-box.success {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.warning-box,
.info-box {
  background: rgba(255, 159, 67, 0.1);
  border: 1px solid rgba(255, 159, 67, 0.3);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-top: 1.5rem;
}

.warning-box h4,
.info-box h4 {
  color: var(--accent-orange);
  margin-bottom: 0.5rem;
}

.info-box {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.info-box h4 {
  color: var(--accent-blue);
}

/* ==========================================
   Profile Module
   ========================================== */

.user-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.user-item {
  background: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-item:hover,
.user-item.active {
  background: var(--accent-cyan);
  color: var(--bg-primary);
}

.profile-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
}

.profile-card.admin-profile {
  border: 2px solid var(--accent-purple);
}

.bio-section {
  margin-top: 1rem;
}

.bio-content {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 8px;
  font-family: var(--font-mono);
}

/* ==========================================
   Wall Module
   ========================================== */

.wall-posts {
  margin-top: 2rem;
}

.post-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.post-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-author {
  font-weight: 600;
  color: var(--accent-cyan);
}

.post-content {
  color: var(--text-primary);
}

.no-posts {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* ==========================================
   Calc Module
   ========================================== */

.result-box {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-box h3 {
  color: var(--accent-green);
  margin-bottom: 0.5rem;
}

.result-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text-primary);
}

.result-value pre {
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================
   Admin Module
   ========================================== */

.access-denied {
  text-align: center;
  padding: 3rem;
}

.lock-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.small-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.admin-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================
   Debug Module
   ========================================== */

.debug-section {
  margin-bottom: 2rem;
}

.debug-section h3 {
  color: var(--accent-cyan);
  margin-bottom: 1rem;
}

.debug-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
}

.debug-table th,
.debug-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.debug-table th {
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-weight: 600;
}

.debug-table td code {
  background: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-green);
}

.status-danger {
  color: var(--accent-red);
  font-weight: 600;
}
.status-success {
  color: var(--accent-green);
}
.status-warning {
  color: var(--accent-orange);
}

.phpinfo-warning {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* ==========================================
   Chat Module (SecuBot)
   ========================================== */

.chat-container {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
}

.chat-messages {
  max-height: 400px;
  overflow-y: auto;
  padding: 1.5rem;
}

.message {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.user-message {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  background: var(--bg-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.message-content {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: 12px;
  max-width: 80%;
}

.user-message .message-content {
  background: var(--accent-cyan);
  color: var(--bg-primary);
}

.chat-form {
  border-top: 1px solid var(--border-color);
  padding: 1rem;
}

.chat-input-group {
  display: flex;
  gap: 0.5rem;
}

.chat-input-group .form-control {
  flex: 1;
}

/* ==========================================
   Instructions Section
   ========================================== */

.instructions-section {
  margin-top: 3rem;
}

.instructions-section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.phase-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.phase-card h3 {
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.phase-card ol {
  margin-left: 1.5rem;
}

.phase-card li {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

/* ==========================================
   Footer
   ========================================== */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.footer .hint {
  color: var(--accent-cyan);
  margin-top: 0.5rem;
}

/* ==========================================
   Locked Modules Message
   ========================================== */

.locked-message {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  margin: 2rem 0;
}

.locked-message .lock-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.locked-message h3 {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.locked-message p {
  color: var(--text-muted);
}

/* Module Featured (Auth Gate when not logged in) */
.module-preview.featured {
  border: 2px solid var(--accent-cyan);
  background: linear-gradient(135deg, var(--bg-card), rgba(0, 245, 255, 0.05));
  box-shadow: var(--shadow-glow);
}

.module-preview.featured::before {
  transform: scaleX(1);
}

/* Module Completed (Auth Gate when logged in) */
.module-preview.completed {
  border: 2px solid var(--accent-green);
  background: linear-gradient(135deg, var(--bg-card), rgba(0, 255, 136, 0.05));
}

.module-preview.completed::before {
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
  transform: scaleX(1);
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    justify-content: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .module-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
