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

/* Main Container */
.admin-dashboard {
  display: flex;
  min-height: 100vh;
  background: #f8f9fa;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
  flex-wrap: nowrap;
}

/* Mobile Menu Toggle */
.admin-mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 100px;
  /* left: 20px; */
  right: 35px;
  z-index: 1101;
  background: #3498db;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.admin-mobile-menu-toggle:hover {
  background: #297fb9cd;
  transform: translateY(-1px);
}

/* Mobile Overlay */
.admin-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.admin-mobile-overlay.active {
  display: block;
}

/* Sidebar Styles - WHITE BACKGROUND - STICKY POSITION */
.admin-sidebar {
  width: 280px;
  position: sticky;
  top: 80px;
  left: 0;
  height: calc(100vh - 80px);
  max-height: calc(100vh - 80px);
  background: #ffffff;
  color: #2c3e50;
  padding-top: 20px;
  padding-bottom: 20px;
  z-index: 999;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border-right: 1px solid #e0e0e0;
  align-self: flex-start;
}

.admin-sidebar.collapsed {
  width: 80px;
}

.admin-sidebar.sidebar-open {
  transform: translateX(0);
}


.admin-sidebar-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px 20px;
  border-bottom: 1px solid #e0e0e0;
  position: relative;
}

.admin-sidebar-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
  transition: opacity 0.3s ease;
}

.admin-sidebar.collapsed .admin-sidebar-header h1 {
  opacity: 0;
  font-size: 0;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  border: none;
  background: transparent;
  color: #5a6c7d;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.active {
  background: #f8f9fa;
  color: #3498db;
  border-radius: 6px;
  border-left-color: #3498db;
}

.admin-sidebar-nav a .icon {
  font-size: 20px;
  margin-right: 15px;
  min-width: 20px;
}

.admin-sidebar.collapsed .admin-sidebar-nav a span:not(.icon) {
  display: none;
}

/* Main Content Area */
.admin-main-content {
  flex: 1;
  margin-left: 0;
  margin-top: 80px;
  padding: 30px;
  padding-bottom: 140px;
  transition: margin-left 0.3s ease-in-out;
  min-height: calc(100vh - 80px);
}

.admin-sidebar.collapsed ~ .admin-main-content {
  margin-left: 0;
}

.admin-content-body {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-content-body h2 {
  font-size: 24px;
  color: #2c3e50;
  margin-bottom: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.admin-content-body h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: #3498db;
  margin-right: 12px;
  border-radius: 2px;
}

.admin-content-body p {
  color: #64748b;
  margin-bottom: 2rem;
}

/* Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Stat Cards */
.admin-stat-card {
  background: #fff;
  border: 2px solid #e8ecef;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
  animation: fadeInUp 0.6s ease forwards;
}

.admin-stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-color: #3498db;
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
}

.admin-stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 28px;
}

.admin-stat-number {
  font-size: 32px;
  color: #2c3e50;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.admin-stat-card h3 {
  font-size: 14px;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Card 1 - Total Users (Blue/Cyan theme) */
.admin-stat-card:nth-child(1)::before {
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.admin-stat-card:nth-child(1) .admin-stat-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
}

.admin-stat-card:nth-child(1) .admin-stat-number {
  color: #06b6d4;
}

/* Card 2 - Total Files (Purple theme) */
.admin-stat-card:nth-child(2)::before {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.admin-stat-card:nth-child(2) .admin-stat-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
}

.admin-stat-card:nth-child(2) .admin-stat-number {
  color: #8b5cf6;
}

/* Card 3 - Approved (Green theme) */
.admin-stat-card:nth-child(3)::before {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.admin-stat-card:nth-child(3) .admin-stat-icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

.admin-stat-card:nth-child(3) .admin-stat-number {
  color: #22c55e;
}

/* Card 4 - Pending (Yellow theme) */
.admin-stat-card:nth-child(4)::before {
  background: linear-gradient(90deg, #eab308, #d97706);
}

.admin-stat-card:nth-child(4) .admin-stat-icon {
  background: linear-gradient(135deg, #eab308, #d97706);
  color: white;
}

.admin-stat-card:nth-child(4) .admin-stat-number {
  color: #eab308;
}

/* Card 5 - Rejected (Red theme) */
.admin-stat-card:nth-child(5)::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.admin-stat-card:nth-child(5) .admin-stat-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.admin-stat-card:nth-child(5) .admin-stat-number {
  color: #ef4444;
}

/* Tables */
.admin-user-table,
.admin-submissions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.admin-user-table thead,
.admin-submissions-table thead {
  background-color: #3498db;
  color: #ffffff;
}

.admin-user-table th,
.admin-user-table td,
.admin-submissions-table th,
.admin-submissions-table td {
  padding: 15px;
  text-align: left;
  font-size: 14px;
}

.admin-user-table th,
.admin-submissions-table th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e0e0e0;
}

.admin-user-table tbody tr,
.admin-submissions-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.admin-user-table tbody tr:nth-child(even),
.admin-submissions-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.admin-user-table tbody tr:hover,
.admin-submissions-table tbody tr:hover {
  background-color: #f1f5f9;
  cursor: pointer;
}

.admin-user-table td,
.admin-submissions-table td {
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.admin-submissions-table a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.admin-submissions-table a:hover {
  text-decoration: underline;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.status-admin,
.status-badge.status-approved {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge.status-user,
.status-badge.status-pending {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-badge.status-rejected {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Action Buttons Container */
.action-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reject-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-submissions-table td:last-child {
  min-width: 200px;
}

.admin-submissions-table form {
  display: inline-block;
  margin: 0;
}

/* Action Buttons */
.admin-submissions-table button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  min-width: 90px;
  white-space: nowrap;
}

/* Approve Button (Green) */
.admin-submissions-table form:has(input[value="approved"]) button[type="submit"] {
  background: #22c55e;
  color: white;
}

.admin-submissions-table form:has(input[value="approved"]) button[type="submit"]:hover {
  background: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Pending Button (Yellow) */
.admin-submissions-table form:has(input[value="pending"]) button[type="submit"] {
  background: #eab308;
  color: white;
}

.admin-submissions-table form:has(input[value="pending"]) button[type="submit"]:hover {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

/* Reject Button (Red) */
.admin-submissions-table form:has(input[value="rejected"]) button[type="submit"] {
  background: #ef4444;
  color: white;
}

.admin-submissions-table form:has(input[value="rejected"]) button[type="submit"]:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Textarea for Comments */
.admin-submissions-table textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  display: block;
  min-height: 60px;
}

.admin-submissions-table textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-stat-card:nth-child(1) { animation-delay: 0.1s; }
.admin-stat-card:nth-child(2) { animation-delay: 0.2s; }
.admin-stat-card:nth-child(3) { animation-delay: 0.3s; }
.admin-stat-card:nth-child(4) { animation-delay: 0.4s; }
.admin-stat-card:nth-child(5) { animation-delay: 0.5s; }

/* Responsive Styles */
@media (max-width: 768px) {
  .admin-mobile-menu-toggle {
    display: block;
  }

  .admin-sidebar {
    position: fixed;
    width: 280px;
    transform: translateX(-100%);
    height: calc(100vh - 80px);
    top: 80px;
    left: 0;
  }

  .admin-sidebar.sidebar-open {
    transform: translateX(0);
    width: 280px;
  }

  .admin-main-content {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 5rem;
    padding-bottom: 140px;
  }

  .admin-content-body {
    padding: 20px;
    border-radius: 8px;
  }

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

  .admin-stat-card {
    padding: 1.5rem;
  }

  .admin-stat-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .admin-stat-number {
    font-size: 28px;
  }

  /* Mobile Table Styles */
  .admin-user-table,
  .admin-submissions-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-user-table thead,
  .admin-submissions-table thead {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  .admin-user-table tbody,
  .admin-submissions-table tbody {
    display: table;
    width: 100%;
  }

  .admin-user-table tr,
  .admin-submissions-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  .admin-user-table th,
  .admin-user-table td,
  .admin-submissions-table th,
  .admin-submissions-table td {
    padding: 12px 8px;
    font-size: 13px;
    word-wrap: break-word;
  }

  /* Submissions table specific mobile adjustments */
  .admin-submissions-table td:last-child {
    min-width: 180px;
  }

  .action-row {
    flex-direction: column;
  }

  .admin-submissions-table button {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    min-width: unset;
  }

  .admin-submissions-table textarea {
    font-size: 12px;
    min-height: 50px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .admin-content-body h2 {
    font-size: 1.25rem;
  }

  .admin-content-body h2::before {
    width: 3px;
    height: 20px;
  }

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

  .admin-main-content {
    padding: 1rem;
    padding-top: 4.5rem;
    padding-bottom: 140px;
  }

  .admin-content-body {
    padding: 15px;
  }

  .admin-stat-card {
    padding: 1.25rem;
  }

  .admin-stat-icon {
    width: 45px;
    height: 45px;
    font-size: 22px;
    margin-bottom: 0.75rem;
  }

  .admin-stat-number {
    font-size: 24px;
  }

  .admin-stat-card h3 {
    font-size: 12px;
  }

  /* Card-style layout for tables on very small screens */
  .admin-user-table,
  .admin-submissions-table {
    border-radius: 0;
    box-shadow: none;
  }

  .admin-user-table thead,
  .admin-submissions-table thead {
    display: none;
  }

  .admin-user-table tbody,
  .admin-submissions-table tbody {
    display: block;
  }

  .admin-user-table tr,
  .admin-submissions-table tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .admin-user-table td,
  .admin-submissions-table td {
    display: block;
    text-align: left;
    padding: 8px 0;
    border: none;
    position: relative;
    padding-left: 50%;
  }

  .admin-user-table td::before,
  .admin-submissions-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 45%;
    padding-right: 10px;
    font-weight: 600;
    color: #2c3e50;
  }

  /* Add data labels via inline styles or JavaScript */
  .admin-user-table td:nth-child(1)::before {
    content: "Name:";
  }

  .admin-user-table td:nth-child(2)::before {
    content: "Email:";
  }

  .admin-user-table td:nth-child(3)::before {
    content: "Role:";
  }

  .admin-submissions-table td:nth-child(1)::before {
    content: "Title:";
  }

  .admin-submissions-table td:nth-child(2)::before {
    content: "Author:";
  }

  .admin-submissions-table td:nth-child(3)::before {
    content: "Email:";
  }

  .admin-submissions-table td:nth-child(4)::before {
    content: "PDF:";
  }

  .admin-submissions-table td:nth-child(5)::before {
    content: "Status:";
  }


  .admin-submissions-table td:last-child {
    padding-left: 0;
    min-width: unset;
  }

  .action-buttons-container {
    width: 100%;
  }

  .admin-submissions-table button {
    padding: 10px 15px;
    font-size: 13px;
  }

  .admin-submissions-table textarea {
    max-width: 100%;
  }

  .status-badge {
    display: inline-block;
    margin-top: 5px;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .admin-main-content {
    padding: 0.75rem;
  }

  .admin-content-body {
    padding: 12px;
  }

  .admin-stat-card {
    padding: 1rem;
  }

  .admin-submissions-table button {
    padding: 8px 12px;
    font-size: 12px;
  }
}
