/* ============================================
   Admin Dashboard - Responsive Professional UI
   ============================================ */

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

:root {
  --primary-color: #FF6B6B;
  --secondary-color: #4ECDC4;
  --dark-color: #2C3E50;
  --light-color: #ECF0F1;
  --text-dark: #333;
  --text-light: #666;
  --border-color: #DDD;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: #F8F9FA;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 20px;
}

.login-box {
  background-color: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
}

.login-box h1 {
  font-size: 32px;
  color: var(--dark-color);
  margin-bottom: 10px;
}

.login-box p {
  color: var(--text-light);
  margin-bottom: 30px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.btn {
  display: inline-block;
  padding: 12px 25px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background-color: #E85555;
}

.btn-secondary {
  background-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #3DB8AF;
}

.btn-danger {
  background-color: #E74C3C;
  padding: 8px 15px;
  width: auto;
}

.btn-danger:hover {
  background-color: #C0392B;
}

.btn-edit {
  background-color: #3498DB;
  padding: 8px 15px;
  width: auto;
  margin-right: 10px;
}

.btn-edit:hover {
  background-color: #2980B9;
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */

.admin-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background-color: var(--dark-color);
  color: white;
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 10px;
}

.sidebar-menu a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 12px 15px;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.sidebar-menu a:hover {
  background-color: var(--primary-color);
}

.admin-content {
  padding: 30px;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.admin-header h1 {
  font-size: 28px;
  color: var(--dark-color);
}

.logout-btn {
  background-color: #E74C3C;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.hamburger-btn {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1002;
}

.hamburger-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--dark-color);
  margin: 5px 0;
  transition: 0.3s;
}

.logout-btn:hover {
  background-color: #C0392B;
}

/* ============================================
   DASHBOARD STATS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card h3 {
  font-size: 32px;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.stat-card p {
  color: var(--text-light);
  font-size: 14px;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  margin-bottom: 30px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background-color: var(--dark-color);
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

table td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

table tr:hover {
  background-color: #F8F9FA;
}

/* ============================================
   FORMS
   ============================================ */

.form-section {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.form-section h2 {
  margin-bottom: 20px;
  color: var(--dark-color);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-grid.full {
  grid-template-columns: 1fr;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
  padding: 15px 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  border-left: 4px solid;
}

.alert-success {
  background-color: #D4EDDA;
  color: #155724;
  border-color: #28A745;
}

.alert-error {
  background-color: #F8D7DA;
  color: #721C24;
  border-color: #F5C6CB;
}

.alert-info {
  background-color: #D1ECF1;
  color: #0C5460;
  border-color: #BEE5EB;
}

#error {
  color: #E74C3C;
  font-size: 14px;
  margin-top: 10px;
}

/* ============================================
   SEARCH BOX
   ============================================ */

.search-box {
  padding: 12px 20px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 14px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 400px;
}

/* ============================================
   TABLET (768px and up)
   ============================================ */

@media (max-width: 768px) {
  .admin-container {
    grid-template-columns: 1fr; /* Keep single column layout */
  }

  .sidebar {
    position: fixed; /* Change to fixed for overlay */
    left: -280px; /* Hide off-screen */
    top: 0;
    width: 280px;
    height: 100%;
    z-index: 1001;
    transition: left 0.3s ease;
  }

  .sidebar.visible {
    left: 0; /* Show sidebar */
  }

  .admin-content {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .hamburger-btn {
    display: block; /* Show hamburger on mobile */
  }

  table {
    font-size: 13px;
  }

  table th, table td {
    padding: 10px;
  }
}

/* ============================================
   MOBILE (Below 768px)
   ============================================ */

@media (max-width: 600px) {
  .login-box {
    padding: 25px;
  }

  .login-box h1 {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  .button-group .btn {
    width: 100%;
  }

  .sidebar-menu a {
    padding: 10px 12px;
    font-size: 13px;
  }

  .admin-content {
    padding: 15px;
  }

  .admin-header {
    margin-bottom: 20px;
  }

  .admin-header h1 {
    font-size: 22px;
  }

  table {
    font-size: 12px;
  }

  table th, table td {
    padding: 8px;
  }
}

/* ============================================
   UTILITIES
   ============================================ */

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

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}