@import url('variables.css');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Base Reset & Typography */
body {
  background-color: #020205;
  /* Deep Black for Professional Feel */
  color: #e2e8f0;
  /* Light Gray for better readability */
  font-family: var(--zm-font-family);
  margin: 0;
  overflow-x: hidden;
  font-size: 0.9rem;
  line-height: 1.6;
}

.brand-text {
  color: #ffffff;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.5px;
}

.brand-highlight {
  color: #3b82f6;
  /* Accent Blue */
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.5px;
}

.text-blue {
  color: #3b82f6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

/* Sidebar Styling */
.sidebar {
  background: #000000;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  width: 250px;
  /* Slightly reduced width */
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 20px;
  transition: var(--zm-transition);
  overflow-y: auto;
  /* Allow scrolling within sidebar if height is small */
}

.sidebar h3 {
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 25px;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li a {
  color: var(--zm-text-muted);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--zm-radius-sm);
  text-decoration: none;
  transition: var(--zm-transition);
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 0.85rem;
}

.sidebar ul li a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar ul li a.active {
  background: var(--zm-accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.sidebar-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #475569;
  margin: 20px 0 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  padding-left: 5px;
}

/* Main Content Area */
.content {
  margin-left: 250px;
  padding: 30px;
  background: #050510;
  min-height: 100vh;
  transition: var(--zm-transition);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 20%);
}

/* Responsive Logic */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  }

  .content {
    margin-left: 0;
    padding: 10px 15px 0 15px;
    /* Reduced Top Padding */
  }

  .sidebar-toggle {
    display: block !important;
    /* Ensure toggle is visible */
  }

  .legends-container {
    margin-left: 65px;
    /* Clearing the fixed sidebar toggle */
    margin-top: -2px;
    /* Pull up into empty space */
    margin-bottom: 15px;
  }

  .legends-header-text {
    font-size: 0.85rem !important;
    /* Much smaller text */
    letter-spacing: 0.5px !important;
    line-height: 1.1;
  }

  .legends-subtext {
    font-size: 0.45rem !important;
    letter-spacing: 1px !important;
    margin-top: 2px;
    opacity: 0.6;
  }
}

/* Sidebar Toggle Button (Mobile) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  background: var(--zm-accent-primary);
  border: none;
  color: #000;
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Admin Card */
/* Admin Card */
.admin-card {
  background: #0a0a16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--zm-radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  animation: zmFadeInUp 0.5s var(--zm-transition) backwards;
}

.text-highlight {
  color: #fff !important;
  font-weight: 600;
}

.text-muted {
  color: #94a3b8 !important;
  /* Lighter mute for better visibility */
}

.admin-card-header h2 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Status Cards (Dashboard) - SpaceCloud Style */
.status-card {
  background: #000 !important;
  /* Pure black cards */
  border-radius: 16px;
  padding: 16px;
  /* Reduced from 24px for better fit */
  display: block;
  /* Stacked layout for label/value */
  border: 1px solid #333;
  transition: var(--zm-transition);
  position: relative;
  overflow: hidden;
  animation: zmFadeInUp 0.6s var(--zm-transition) backwards;
  min-height: 120px;
  /* Reduced min-height */
}

/* Colored Borders based on child index */
.status-card:nth-child(1) {
  border: 1px solid var(--zm-border-blue);
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

.status-card:nth-child(2) {
  border: 1px solid var(--zm-border-green);
  box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.1);
}

.status-card:nth-child(3) {
  border: 1px solid var(--zm-border-orange);
  box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.1);
}

.status-card:nth-child(4) {
  border: 1px solid var(--zm-border-purple);
  box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.1);
}

/* Animation Delays */
.status-card:nth-child(1) {
  animation-delay: 0.05s;
}

.status-card:nth-child(2) {
  animation-delay: 0.1s;
}

.status-card:nth-child(3) {
  animation-delay: 0.15s;
}

.status-card:nth-child(4) {
  animation-delay: 0.2s;
}

.status-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.status-icon {
  display: none;
  /* Hide icon for this theme as per SpaceCloud ref */
}

/* Custom Layout for Card Content */
.status-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.status-info h3 {
  /* Label */
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  opacity: 0.8;
}

.status-info p {
  /* Value */
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-top: auto;
  font-family: 'Outfit', sans-serif;
}

/* Forms & Inputs */
/* Forms & Inputs */
.form-control {
  background-color: #0f172a !important;
  /* Force Dark Blue/Black */
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  /* Force White Text */
  border-radius: var(--zm-radius-sm);
  padding: 10px 15px;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.form-select {
  background-color: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  /* White Arrow */
}

.form-control:focus {
  background: var(--zm-bg-dark);
  border-color: var(--zm-accent-primary);
  color: var(--zm-text-main);
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.btn-primary {
  background: var(--zm-accent-gradient);
  border: none;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--zm-radius-sm);
}

.btn-primary:hover {
  box-shadow: var(--zm-accent-glow);
  filter: brightness(1.1);
}

/* Data Tables - Command OS Style */
.table {
  margin-top: 20px;
  --bs-table-bg: #000;
  --bs-table-color: #e2e8f0;
  /* Lighter text */
  --bs-table-border-color: rgba(255, 255, 255, 0.1);
  background: #000;
  border-radius: var(--zm-radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  margin-bottom: 0;
}

.table thead {
  background: #050510;
}

.table th {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: #475569;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 18px 16px;
  border-top: none;
}

.table td {
  vertical-align: middle;
  padding: 16px;
  transition: var(--zm-transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  color: #ffffff !important;
  /* Force pure white in tables */
  font-weight: 500;
}

.table tbody tr {
  transition: var(--zm-transition);
  cursor: pointer;
  /* Clickable rows hint */
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.05) !important;
  transform: translateX(5px);
}

.table tbody tr:hover td:first-child {
  color: var(--zm-text-highlight);
  border-left: 2px solid var(--zm-accent-primary);
}

/* Row Rank/Badge Style (Optional helper for 'No1' look) */
.table-rank-badge {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-right: 10px;
  font-weight: 700;
}

/* Pagination - Command OS Style */
.pagination {
  margin-top: 20px;
  gap: 5px;
}

.page-link {
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.page-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.page-item.active .page-link {
  background: var(--zm-accent-primary);
  border-color: var(--zm-accent-primary);
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.page-item.disabled .page-link {
  background: #000;
  border-color: rgba(255, 255, 255, 0.02);
  color: #334155;
}

/* Custom Alert/Message Style */
.alert {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-radius: var(--zm-radius-sm);
  font-size: 0.9rem;
  padding: 12px 16px;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Stats Container Grid */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  /* Reduced from 240px to allow 5 in a row */
  gap: 24px;
  margin-bottom: 30px;
}

/* User Profile Hover Animation */
#userProfileDropdown {
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.dropdown:hover #userProfileDropdown {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--zm-accent-primary) !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.2);
}

.dropdown-menu {
  display: none;
  /* Default hidden */
  animation: zmSlideDown 0.3s ease forwards;
  margin-top: 10px;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

@keyframes zmSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Header Styles (Mobile Enhancements) */
@media (max-width: 992px) {
  .legends-container {
    margin-left: 60px;
    /* Space for fixed sidebar toggle */
    margin-top: 10px;
  }

  .legends-header-text {
    font-size: 1rem !important;
    /* Smaller text for mobile */
    letter-spacing: 0.5px !important;
  }

  .legends-subtext {
    font-size: 0.55rem !important;
    letter-spacing: 1px !important;
  }
}