/* ========================================================
   IPS Premium Management Portal Stylesheet
   ======================================================== */

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

:root {
  /* Curated HSL Color System */
  --primary-color: hsl(243, 75%, 59%); /* Indigo */
  --primary-dark: hsl(243, 75%, 49%);
  --primary-light: hsl(243, 85%, 85%);
  --accent-color: hsl(268, 75%, 50%); /* Violet */
  --secondary-color: hsl(210, 40%, 96.1%); /* Slate light */
  --dark-color: hsl(222, 47%, 11%); /* Dark Slate */
  
  /* Sidebar Palette */
  --sidebar-bg: hsl(222, 47%, 8%); /* Extra Deep Navy-Slate */
  --sidebar-hover: hsl(222, 47%, 14%);
  --sidebar-border: rgba(255, 255, 255, 0.05);
  --text-light: hsl(210, 40%, 98%);
  
  /* UI Backgrounds */
  --body-bg: hsl(210, 40%, 98%);
  --card-bg: hsl(0, 0%, 100%);
  
  /* Curated Status Colors (Non-generic) */
  --success-color: hsl(150, 84%, 37%); /* Emerald */
  --success-bg: hsl(150, 84%, 96%);
  --warning-color: hsl(38, 92%, 50%); /* Amber */
  --warning-bg: hsl(38, 92%, 96%);
  --danger-color: hsl(350, 89%, 60%); /* Rose-Red */
  --danger-bg: hsl(350, 89%, 97%);
  --info-color: hsl(200, 95%, 48%); /* Sky Blue */
  --info-bg: hsl(200, 95%, 96%);
  
  /* Borders & Shadows */
  --border-color: hsl(214.3, 31.8%, 91.4%);
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  
  /* Soft Premium Box Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.08), 0 15px 20px -10px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.15);
  
  /* Transitions */
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  background-color: var(--body-bg);
  color: var(--dark-color);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--body-bg);
}
::-webkit-scrollbar-thumb {
  background: hsl(214.3, 31.8%, 80%);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(214.3, 31.8%, 70%);
}

/* Sidebar Wrapper Layout */
#wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
}

#sidebar {
  min-width: 260px;
  max-width: 260px;
  background: var(--sidebar-bg);
  color: var(--text-light);
  transition: var(--transition-base);
  min-height: 100vh;
  box-shadow: 10px 0 30px rgba(0,0,0,0.15);
  border-right: 1px solid var(--sidebar-border);
  z-index: 100;
}

#sidebar .sidebar-header {
  padding: 30px 24px;
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  border-bottom: 1px solid var(--sidebar-border);
}

#sidebar .sidebar-header h3 {
  font-weight: 800;
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, hsl(0, 0%, 100%) 0%, hsl(210, 40%, 80%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#sidebar .sidebar-header p {
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
}

#sidebar ul.components {
  padding: 25px 12px;
}

#sidebar ul li {
  margin-bottom: 6px;
  list-style: none;
}

#sidebar ul li a {
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition-fast);
  border-radius: var(--border-radius-sm);
  gap: 12px;
}

#sidebar ul li a i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  opacity: 0.8;
  transition: var(--transition-fast);
}

#sidebar ul li a:hover {
  color: hsl(0, 0%, 100%);
  background: var(--sidebar-hover);
}

#sidebar ul li a:hover i {
  transform: scale(1.1);
  opacity: 1;
}

#sidebar ul li.active > a {
  color: hsl(0, 0%, 100%);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
  font-weight: 600;
}

#sidebar ul li.active > a i {
  opacity: 1;
}

/* Page Content */
#content {
  width: 100%;
  padding: 30px;
  transition: var(--transition-base);
  background-color: var(--body-bg);
}

/* Navbar inside content */
.navbar {
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  border-radius: var(--border-radius-md);
  padding: 16px 24px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

/* Cards style */
.dashboard-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  overflow: hidden;
  position: relative;
  background: var(--card-bg);
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.dashboard-card .card-body {
  padding: 24px;
  z-index: 2;
  position: relative;
}

.dashboard-card .icon-bg {
  position: absolute;
  right: -8px;
  bottom: -8px;
  font-size: 5.5rem;
  opacity: 0.08;
  z-index: 1;
  transition: var(--transition-base);
}

.dashboard-card:hover .icon-bg {
  transform: scale(1.1) rotate(-5deg);
  opacity: 0.12;
}

.card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  color: hsl(215.4, 16.3%, 46.9%);
  margin-bottom: 8px;
}

.card-value {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 0;
  color: var(--dark-color);
  font-family: 'Outfit', sans-serif;
}

/* Premium Card Gradients */
.bg-gradient-primary {
  background: linear-gradient(135deg, hsl(243, 75%, 59%) 0%, hsl(258, 75%, 65%) 100%);
  color: white;
  border: none;
}
.bg-gradient-primary .card-title, .bg-gradient-primary .card-value {
  color: white;
}
.bg-gradient-primary .icon-bg {
  color: white;
}

.bg-gradient-success {
  background: linear-gradient(135deg, hsl(150, 84%, 37%) 0%, hsl(162, 76%, 42%) 100%);
  color: white;
  border: none;
}
.bg-gradient-success .card-title, .bg-gradient-success .card-value {
  color: white;
}
.bg-gradient-success .icon-bg {
  color: white;
}

.bg-gradient-warning {
  background: linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(45, 93%, 58%) 100%);
  color: white;
  border: none;
}
.bg-gradient-warning .card-title, .bg-gradient-warning .card-value {
  color: white;
}
.bg-gradient-warning .icon-bg {
  color: white;
}

.bg-gradient-danger {
  background: linear-gradient(135deg, hsl(350, 89%, 60%) 0%, hsl(355, 90%, 68%) 100%);
  color: white;
  border: none;
}
.bg-gradient-danger .card-title, .bg-gradient-danger .card-value {
  color: white;
}
.bg-gradient-danger .icon-bg {
  color: white;
}

/* Advanced Tables */
.table-custom {
  background: var(--card-bg);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border: 1px solid var(--border-color);
}

.table-custom thead th {
  background: hsl(210, 40%, 96.1%);
  border-bottom: 2px solid var(--border-color);
  font-weight: 700;
  color: hsl(215.4, 16.3%, 46.9%);
  padding: 16px 20px;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-custom tbody tr {
  transition: var(--transition-fast);
}

.table-custom tbody tr:hover {
  background-color: hsl(210, 40%, 96.1%);
  box-shadow: inset 4px 0 0 var(--primary-color);
}

.table-custom td {
  padding: 16px 20px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  color: hsl(215, 25%, 27%);
  font-size: 0.92rem;
}

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

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

.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Custom Buttons styling */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
  transition: var(--transition-base);
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-color) 100%);
  color: white;
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.35);
  transform: translateY(-2px);
}

/* Custom Inputs Form Control */
.form-control-custom {
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  background: hsl(210, 40%, 98%);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-control-custom:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: #fff;
  outline: none;
}

/* Student Avatars */
.student-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transition: var(--transition-base);
}

.student-avatar:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.student-avatar-initials {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  border: 2px solid #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* DMC Student Photo Styling */
.dmc-photo-container {
  border: 2px solid hsl(243, 75%, 59%);
  padding: 4px;
  background-color: #fff;
  width: 120px;
  height: 140px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.dmc-student-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.dmc-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: hsl(210, 40%, 96.1%);
  border: 2px dashed hsl(214.3, 31.8%, 80%);
  border-radius: 4px;
  color: hsl(215.4, 16.3%, 46.9%);
  font-size: 0.72rem;
  text-align: center;
  padding: 8px;
}

/* Responsive Grid / Layout adjustments */
@media (max-width: 768px) {
  #sidebar {
    margin-left: -260px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: none;
  }
  
  #sidebar.active {
    margin-left: 0 !important;
    box-shadow: 10px 0 30px rgba(0,0,0,0.15);
  }
  
  #content {
    padding: 16px;
  }
  
  .navbar {
    padding: 12px 16px;
    margin-bottom: 20px;
  }
  
  .card-value {
    font-size: 1.8rem;
  }
  
  .dashboard-card .icon-bg {
    font-size: 4rem;
  }
  
  .table-custom td, .table-custom th {
    padding: 12px 14px;
    font-size: 0.85rem;
  }
  
  /* Mobilized table rows view helper */
  .table-responsive-stack .table-custom thead {
    display: none;
  }
  
  .table-responsive-stack .table-custom tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
  }
  
  .table-responsive-stack .table-custom td {
    display: block;
    text-align: right;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .table-responsive-stack .table-custom td::before {
    content: attr(data-label);
    float: left;
    font-weight: 700;
    color: hsl(215.4, 16.3%, 46.9%);
    text-transform: uppercase;
    font-size: 0.75rem;
  }
  
  .table-responsive-stack .table-custom td:last-child {
    border-bottom: none;
  }
}

@media (min-width: 769px) {
  #sidebar.active {
    margin-left: -260px;
  }
  
  #sidebar.active + #content {
    width: 100%;
  }
}
