/* 
  S S Academy & Higher Studies - Admin Panel Stylesheet
  File: assets/css/admin.css
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --admin-primary: #0a1128;      /* Deep Navy */
  --admin-accent: #3f4cff;       /* Royal Blue */
  --admin-purple: #7b2cff;       /* Purple Highlight */
  --admin-cta: #ffbf22;          /* Gold CTA */
  --admin-bg: #f8fafc;           /* Light grey-blue bg */
  --admin-card-bg: #ffffff;
  --admin-text-dark: #0f172a;
  --admin-text-muted: #64748b;
  --admin-border: #e2e8f0;
  --admin-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --admin-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --admin-radius: 12px;
  --admin-radius-sm: 8px;
  --admin-transition: all 0.3s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-dark);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- Layout Structure --- */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-primary);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: var(--admin-transition);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  height: 35px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

.sidebar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sidebar-title span {
  color: var(--admin-cta);
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.sidebar-menu {
  flex-grow: 1;
  padding: 20px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  font-weight: 550;
  font-size: 0.925rem;
  color: rgba(255, 255, 255, 0.7);
  border-left: 4px solid transparent;
  transition: var(--admin-transition);
}

.menu-item svg {
  width: 20px;
  height: 20px;
  opacity: 0.75;
}

.menu-item:hover, .menu-item.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
  border-left-color: var(--admin-accent);
  background-color: rgba(63, 76, 255, 0.08);
}

.menu-item.active svg {
  opacity: 1;
  color: var(--admin-accent);
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Main Content Area --- */
.admin-main {
  flex-grow: 1;
  margin-left: 260px;
  padding: 30px;
  width: calc(100% - 260px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.admin-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--admin-primary);
}

.admin-user-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-username {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--admin-primary);
}

/* --- Buttons & Badges --- */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--admin-radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--admin-transition);
  gap: 8px;
}

.admin-btn-primary {
  background-color: var(--admin-accent);
  color: #ffffff;
}

.admin-btn-primary:hover {
  background-color: #2c38d1;
}

.admin-btn-danger {
  background-color: #ef4444;
  color: #ffffff;
}

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

.admin-btn-secondary {
  background-color: #f1f5f9;
  border-color: var(--admin-border);
  color: var(--admin-text-dark);
}

.admin-btn-secondary:hover {
  background-color: #e2e8f0;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-active, .badge-read {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-inactive, .badge-new {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* --- Dashboard Overview Widgets --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background-color: var(--admin-card-bg);
  border-radius: var(--admin-radius);
  padding: 24px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info h3 {
  font-size: 0.825rem;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-info .stat-number {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--admin-primary);
  line-height: 1;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background-color: rgba(63, 76, 255, 0.08);
  color: var(--admin-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

/* --- Tables & Lists --- */
.card {
  background-color: var(--admin-card-bg);
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  overflow: hidden;
  margin-bottom: 30px;
}

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

.card-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--admin-primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
  background-color: #f8fafc;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  text-transform: uppercase;
}

.admin-table td {
  font-size: 0.9rem;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.table-thumbnail {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--admin-border);
}

.action-links {
  display: flex;
  gap: 12px;
}

.action-link-edit {
  color: var(--admin-accent);
  font-weight: 600;
}

.action-link-delete {
  color: #ef4444;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* --- Form Designs --- */
.admin-form {
  padding: 30px;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--admin-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--admin-text-dark);
  background-color: #ffffff;
  transition: var(--admin-transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(63, 76, 255, 0.15);
}

.image-preview-box {
  margin-top: 12px;
  border: 1.5px dashed var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 12px;
  max-width: 250px;
  background-color: #f8fafc;
}

.image-preview-box img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* --- Login Page --- */
.login-body {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--admin-primary) 0%, #101f42 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: #ffffff;
  border-radius: var(--admin-radius);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--admin-accent), var(--admin-purple));
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.admin-login-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  margin-bottom: 12px;
}

.login-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  color: var(--admin-primary);
  margin-bottom: 6px;
}

.login-header p {
  color: var(--admin-text-muted);
  font-size: 0.875rem;
}

/* --- Mobile Menu Trigger --- */
.admin-mobile-header {
  display: none;
  background-color: var(--admin-primary);
  color: #ffffff;
  padding: 15px 20px;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 101;
}

.hamburger-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
}

.hamburger-btn svg {
  width: 26px;
  height: 26px;
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
  .admin-sidebar {
    left: -260px;
    height: 100vh;
    padding-top: 60px;
  }
  
  .admin-sidebar.open {
    left: 0;
  }
  
  .admin-mobile-header {
    display: flex;
  }
  
  body {
    padding-top: 60px;
  }
  
  .admin-main {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }
  
  /* Tables layout stack on mobile */
  .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr {
    display: block;
  }
  
  .admin-table thead {
    display: none; /* Hide header rows */
  }
  
  .admin-table tr {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-sm);
    margin-bottom: 15px;
    background-color: #ffffff;
    padding: 12px;
    box-shadow: var(--admin-shadow);
  }
  
  .admin-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
  }
  
  .admin-table td:last-child {
    border-bottom: none;
  }
  
  .admin-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--admin-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    text-align: left;
    float: left;
  }
  
  .table-thumbnail {
    width: 80px;
    height: 60px;
  }
}
