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

:root {
  /* Color System */
  --bg-main: #070a13;
  --bg-gradient: radial-gradient(circle at 50% 0%, #151b30 0%, #070a13 70%);
  --bg-card: rgba(15, 23, 42, 0.55);
  --bg-card-hover: rgba(23, 37, 84, 0.45);
  --border-color: rgba(99, 102, 241, 0.15);
  --border-color-hover: rgba(99, 102, 241, 0.35);
  
  --primary: hsl(243, 75%, 59%);
  --primary-glow: rgba(99, 102, 241, 0.3);
  --success: hsl(142, 70%, 45%);
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: hsl(38, 92%, 50%);
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: hsl(350, 89%, 60%);
  --danger-glow: rgba(244, 63, 94, 0.2);
  --accent: hsl(271, 91%, 65%);
  --accent-glow: rgba(168, 85, 247, 0.2);
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-neon: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-main);
}

body {
  background: var(--bg-main);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Glassmorphism template classes */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}
.glass-panel:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-neon);
}

/* Floating widgets header navbar */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  background: rgba(7, 10, 19, 0.7);
  backdrop-filter: blur(20px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.nav-menu-bar {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  flex: 1;
  margin: 0 1.5rem;
  padding-bottom: 6px;
}

.nav-menu-bar::-webkit-scrollbar {
  height: 4px;
  display: block;
}

.nav-menu-bar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

.nav-menu-bar::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.nav-menu-bar::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.floating-widget-btn {
  flex-shrink: 0;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.floating-widget-btn:hover {
  color: var(--text-primary);
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 12px var(--primary-glow);
}

.floating-widget-btn.active {
  color: var(--text-primary);
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-glow), rgba(168, 85, 247, 0.1));
  box-shadow: 0 0 15px var(--primary-glow);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

.user-badge .role-indicator {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-student { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.role-hod { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.role-principal { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.role-admin { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  padding: 0.25rem;
}
.logout-btn:hover {
  color: var(--danger);
  transform: scale(1.1);
}

/* Screen Transitions and Main Layout */
main {
  margin-top: 70px;
  min-height: calc(100vh - 70px);
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.view-container {
  width: 100%;
  max-width: 1200px;
  display: none;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-container.active {
  display: block;
}

/* Authentication Views (Login & Register) */
.auth-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.auth-card {
  width: 100%;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.role-selection-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.role-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: calc(var(--radius-md) - 4px);
  transition: var(--transition-smooth);
}

.role-tab.active {
  background: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Form Styling & Validation Styles */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group input, .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  background: rgba(0, 0, 0, 0.35);
}

.form-group select option {
  background: #0f172a;
  color: var(--text-primary);
}

/* URL Input helper styles */
.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 2.75rem;
}

/* Error message indicators for invalid fields */
.error-msg {
  display: none;
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.35rem;
  font-weight: 500;
  align-items: center;
  gap: 0.25rem;
}

.form-group input:user-invalid {
  border-color: var(--danger);
  background-color: rgba(244, 63, 94, 0.05);
}

.form-group input:user-invalid + .error-msg {
  display: flex;
}

/* Class based fallback for dynamic JS check */
.has-error input {
  border-color: var(--danger) !important;
  background-color: rgba(244, 63, 94, 0.05) !important;
}
.has-error .error-msg {
  display: flex !important;
}

.btn-primary {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.auth-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Dashboard Body & Panels */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: var(--accent); }

.stat-info h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
}

.stat-info .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

/* Floating Widgets Panels Styling */
.widget-panel {
  display: none;
  margin-bottom: 2rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.widget-panel.active {
  display: block;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-controls {
  display: flex;
  gap: 1rem;
}

.search-input-group {
  position: relative;
  width: 250px;
}

.search-input-group i {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-group input {
  width: 100%;
  padding: 0.4rem 0.8rem 0.4rem 2.2rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.search-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  width: 300px;
}

.filter-select {
  padding: 0.4rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

/* Tabular display for dashboard data */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

thead {
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-color);
}

th {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: var(--transition-smooth);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.student-roll-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.student-roll-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.platform-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.75rem;
}

.rank-top-1 { background: rgba(245, 158, 11, 0.2); color: var(--warning); border: 1px solid var(--warning); }
.rank-top-2 { background: rgba(168, 85, 247, 0.2); color: var(--accent); border: 1px solid var(--accent); }
.rank-top-3 { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid #818cf8; }
.rank-standard { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

/* Platform Score Breakdown horizontal list */
.platform-scores-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pf-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}
.pf-lc { background: rgba(239, 162, 53, 0.15); color: #efa235; }
.pf-hr { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.pf-cf { background: rgba(58, 150, 243, 0.15); color: #3a96f3; }
.pf-gfg { background: rgba(47, 137, 85, 0.15); color: #2f8955; }

/* Dialog Overlay - Detail Popup and Crawler */
dialog {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-color-hover);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  margin: auto;
  padding: 2.5rem;
  width: 90%;
  max-width: 650px;
  outline: none;
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

dialog::backdrop {
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(8px);
}

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

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

/* Detail Popup Styles */
.student-profile-popup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.profile-avatar-sec {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--border-color);
  padding-right: 1.5rem;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
}

.profile-roll {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-branch {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.profile-rank-indicator {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  width: 100%;
}

.rank-mini-card {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.rank-mini-card span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.rank-mini-card strong {
  font-size: 1.1rem;
  color: var(--warning);
}

.profile-stats-sec {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.profile-stat-row span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.profile-stat-row strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Compare View Layout */
.compare-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.compare-input-card {
  padding: 1.5rem;
}

.compare-input-card h3 {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compare-results-wrapper {
  margin-top: 2rem;
}

.compare-table {
  width: 100%;
}

.verdict-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.1));
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: glowPulse 2s infinite ease-in-out;
}

.verdict-icon {
  font-size: 2.2rem;
  color: var(--warning);
}

.verdict-info h4 {
  color: var(--success);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.verdict-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Crawler Loading dialog styles */
.crawler-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

.crawler-logo-container {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crawler-logo-animated {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
  animation: pulseLogo 2s infinite ease-in-out;
  border: 2px solid var(--border-color);
}

.crawler-pulse-ring {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  animation: pulseRing 2s infinite cubic-bezier(0.215, 0.610, 0.355, 1);
  z-index: 1;
}

@keyframes pulseLogo {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(99, 102, 241, 0.6);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(0.95);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.crawler-progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.crawler-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.crawler-status-logs {
  background: #030712;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  width: 100%;
  height: 120px;
  padding: 0.75rem;
  text-align: left;
  font-family: monospace;
  font-size: 0.8rem;
  color: #10b981;
  overflow-y: auto;
}

.crawler-log-line {
  margin-bottom: 0.35rem;
}

/* Student Profile Own Dashboard Page */
.student-profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.student-self-info-card {
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.student-self-stats-card {
  padding: 2rem;
}

/* Keyframes animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.1); }
  50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.25); }
  100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.1); }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .compare-container, .student-profile-popup, .student-profile-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-avatar-sec {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 1.5rem;
  }
  
  .nav-container {
    padding: 0 1rem;
  }
  
  .nav-menu-bar {
    gap: 0.5rem;
  }
  
  .floating-widget-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .logo-text {
    display: none;
  }
}

/* Floating Batch Selector Widget */
.floating-batch-widget {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  margin: 1.5rem auto;
  width: max-content;
  max-width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 50;
  transition: var(--transition-smooth);
}

.floating-batch-widget:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-neon);
}

.batch-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.batch-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.batch-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Admin Portal Layout & Elements */
.admin-wrapper {
  max-width: 1200px;
  margin: 90px auto 2rem;
  padding: 0 1rem;
}

.admin-panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.admin-panel.active {
  display: block;
}

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

/* Timeline Activity tracker style */
.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.activity-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 140px;
}

.activity-user {
  font-weight: 700;
  color: var(--primary);
}

.activity-text {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* Notice Boards Banners and Lists */
.announcements-banner-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.announcement-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
  animation: slideInDown 0.4s ease;
}

.announcement-banner.priority-urgent {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(244, 63, 94, 0.2) 100%);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}

.announcement-banner.priority-normal {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-color: var(--border-color);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.05);
}

@keyframes slideInDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.announcement-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.announcement-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.announcement-msg {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.notice-badge {
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
}

.notice-badge.priority-normal { background: var(--primary-glow); color: #818cf8; }
.notice-badge.priority-imp { background: var(--warning-glow); color: #fbbf24; }
.notice-badge.priority-urgent { background: var(--danger-glow); color: #f87171; }

/* Admin access / notices table actions */
.btn-action-small {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.btn-action-small.btn-see { background: var(--primary-glow); color: #818cf8; }
.btn-action-small.btn-edit { background: var(--warning-glow); color: #fbbf24; }
.btn-action-small.btn-delete { background: var(--danger-glow); color: #f87171; }

.btn-action-small:hover {
  filter: brightness(1.2);
}

/* Input boxes inside forms */
.input-text {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.input-text:focus {
  border-color: var(--border-color-hover);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

/* Principal Branch Selection Dialog Styles */
.branch-select-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 8px);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.branch-select-btn i {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.3s ease;
}

.branch-select-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15);
}

.branch-select-btn:hover i {
  transform: scale(1.1);
}

.branch-select-btn:active {
  transform: translateY(-1px);
}

/* Lightweight Footer Styles */
.app-footer {
  width: 100%;
  padding: 1rem 2rem;
  border-top: 1px solid var(--border-color);
  background: rgba(7, 10, 19, 0.4);
  backdrop-filter: blur(10px);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-divider {
  color: rgba(255, 255, 255, 0.1);
}


/* ========== V2: OTP VERIFICATION ========== */
.otp-verify-row { display: flex; gap: 0.5rem; align-items: flex-end; margin-top: 0.5rem; }
.otp-verify-row > .input-with-icon { flex: 1; }
.btn-otp-send { background: linear-gradient(135deg, hsl(243,75%,59%), hsl(271,91%,65%)); color: #fff; border: none; border-radius: var(--radius-sm); padding: 0.65rem 0.9rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: var(--transition-smooth); font-family: inherit; height: 42px; }
.btn-otp-send:hover { opacity: 0.85; }
.btn-otp-send:disabled { opacity: 0.4; cursor: default; }
.otp-input-row { display: none; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.otp-input-row.visible { display: flex; }
.otp-input-row input { flex: 1; letter-spacing: 6px; font-size: 1.1rem; font-weight: 700; text-align: center; }
.btn-otp-verify { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #34d399; border-radius: var(--radius-sm); padding: 0.55rem 0.9rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-otp-verify:hover { background: rgba(16,185,129,0.25); }
.otp-verified-badge { display: none; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #34d399; font-weight: 600; margin-top: 0.35rem; }
.otp-verified-badge.visible { display: flex; }
.otp-timer { font-size: 0.78rem; color: var(--warning); margin-top: 0.25rem; }

/* ========== V2: ROLE INDICATOR - IC ========== */
.role-internship_coordinator { background: linear-gradient(135deg, rgba(20,184,166,0.2), rgba(6,182,212,0.2)); color: #2dd4bf; border: 1px solid rgba(45,212,191,0.3); }

/* ========== V2: IC PORTAL VIEW ========== */
#ic-widgets { display: none; gap: 0.5rem; }
#view-ic { display: none; padding: 0; }
#view-ic.active { display: block; }
.ic-wrapper { padding: 1rem 2rem 2rem; }
.ic-panel { display: none; }
.ic-panel.active { display: block; }
.ic-publish-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; margin-top: 1.5rem; align-items: start; }
@media (max-width: 900px) { .ic-publish-layout { grid-template-columns: 1fr; } }
.ic-student-list-panel { padding: 1.5rem; }
.ic-student-list-panel h3 { margin-bottom: 1rem; }
.ic-student-list { max-height: 55vh; overflow-y: auto; padding-right: 0.25rem; }
.ic-student-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); border: 1px solid var(--border-color); margin-bottom: 0.5rem; background: rgba(15,23,42,0.3); font-size: 0.875rem; transition: background 0.2s; }
.ic-student-row:hover { background: rgba(99,102,241,0.07); }
.ic-student-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.ic-student-name { font-weight: 600; font-size: 0.85rem; }
.ic-student-meta { font-size: 0.75rem; color: var(--text-secondary); }
.ic-publish-right { display: flex; flex-direction: column; gap: 1.5rem; }
.ic-title-builder { padding: 1.5rem; position: relative; z-index: 10; }
.ic-published-log { position: relative; z-index: 1; }
.ic-title-input-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.ic-title-input-row input { flex: 1; padding: 0.65rem 0.9rem; background: rgba(0,0,0,0.25); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s; }
.ic-title-input-row input:focus { border-color: var(--primary); }
.ic-items-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; max-height: 220px; overflow-y: auto; }
.ic-item-row { display: flex; align-items: center; gap: 0.5rem; background: rgba(99,102,241,0.06); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; font-size: 0.875rem; }
.ic-item-row span { flex: 1; }
.btn-ic-delete-item { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.9rem; padding: 0.2rem 0.35rem; border-radius: 4px; transition: background 0.2s; }
.btn-ic-delete-item:hover { background: rgba(244,63,94,0.12); }
.ic-add-item-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.ic-add-item-row input { flex: 1; padding: 0.55rem 0.8rem; background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 0.9rem; outline: none; }
.ic-add-item-row input:focus { border-color: var(--primary); }
.btn-ic-add-item { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); color: var(--primary); border-radius: var(--radius-sm); padding: 0.55rem 1rem; cursor: pointer; font-weight: 700; font-size: 1.1rem; transition: background 0.2s; font-family: inherit; }
.btn-ic-add-item:hover { background: rgba(99,102,241,0.28); }
.ic-publish-filters { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ic-publish-filters select { flex: 1; min-width: 120px; }
.btn-ic-publish { width: 100%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none; border-radius: var(--radius-sm); padding: 0.75rem; font-size: 1rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s; font-family: inherit; }
.btn-ic-publish:hover { opacity: 0.88; }
.ic-published-log { padding: 1.5rem; }
.ic-published-title-card { background: rgba(15,23,42,0.5); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 0.75rem; transition: border-color 0.2s; }
.ic-published-title-card:hover { border-color: var(--border-color-hover); }
.ic-published-title-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.ic-published-title-header strong { color: var(--primary); font-size: 0.95rem; }
.ic-title-meta { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.ic-published-items-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ic-chip { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); border-radius: var(--radius-full); padding: 0.2rem 0.65rem; font-size: 0.78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.3rem; }
.btn-chip-delete { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.75rem; padding: 0; line-height: 1; }

/* ========== V2: STUDENT INTERNSHIP PORTAL ========== */
.student-internship-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; margin-top: 1rem; align-items: start; }
@media (max-width: 900px) { .student-internship-layout { grid-template-columns: 1fr; } }
.student-internship-profile-card { padding: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; position: sticky; top: 80px; }
.student-internship-profile-card .profile-avatar { width: 72px; height: 72px; font-size: 1.6rem; }
.internship-titles-container { display: flex; flex-direction: column; gap: 1.5rem; }
.internship-title-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 1.5rem; transition: border-color 0.2s; }
.internship-title-card:hover { border-color: var(--border-color-hover); }
.internship-title-card.locked { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.03); }
.internship-title-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.internship-title-card-header h3 { font-size: 1rem; color: var(--primary); }
.internship-locked-badge { font-size: 0.75rem; color: #34d399; background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.25); border-radius: var(--radius-full); padding: 0.2rem 0.65rem; display: flex; align-items: center; gap: 0.35rem; }
.internship-items-grid { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.internship-item-checkbox-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.9rem; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: rgba(15,23,42,0.3); cursor: pointer; transition: all 0.2s; }
.internship-item-checkbox-row:hover:not(.locked-item) { border-color: var(--primary); background: rgba(99,102,241,0.07); }
.internship-item-checkbox-row.checked { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.1); }
.internship-item-checkbox-row.locked-item { cursor: default; }
.internship-item-checkbox-row input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.internship-item-checkbox-row label { flex: 1; font-size: 0.9rem; cursor: pointer; }
.internship-item-checkbox-row.locked-item label { cursor: default; }
.btn-internship-submit { width: 100%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none; border-radius: var(--radius-sm); padding: 0.75rem; font-size: 0.95rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: opacity 0.2s; }
.btn-internship-submit:hover { opacity: 0.88; }
.btn-internship-submit:disabled { opacity: 0.35; cursor: default; }
.internship-empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.internship-empty-state i { font-size: 2.5rem; margin-bottom: 1rem; color: var(--text-muted); display: block; }

/* ========== V2: INTERNSHIP COLUMNS / OVERVIEW ========== */
.internship-title-group { margin-bottom: 0.35rem; }
.internship-title-label { font-size: 0.75rem; font-weight: 600; color: var(--primary); margin-bottom: 0.2rem; }
.internship-tag { display: inline-block; background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); border-radius: var(--radius-full); padding: 0.15rem 0.55rem; font-size: 0.72rem; color: var(--text-secondary); margin: 0.1rem; }
.no-internships-msg { color: var(--text-secondary); font-size: 0.85rem; font-style: italic; }
.ic-overview-controls { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }

/* ========== V2: CUSTOM MULTISELECT DROPDOWNS ========== */
.custom-multiselect {
  position: relative;
  flex: 1;
  min-width: 120px;
}

.multiselect-select-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  border-radius: var(--radius-sm, 6px);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
}

.multiselect-options {
  display: none;
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background-color: #111522 !important;
  background: #111522 !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 6px);
  z-index: 99999 !important;
  max-height: 180px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9) !important;
  padding: 0.5rem;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.multiselect-options.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.multiselect-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
}

.multiselect-options label:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.multiselect-options input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ========== V2: RESPONSIVE MEDIA QUERIES OVERRIDES ========== */
@media (max-width: 768px) {
  /* 1. Header Navigation Layout Grid */
  .nav-container {
    display: grid !important;
    grid-template-columns: auto auto !important;
    grid-template-rows: auto auto !important;
    height: auto !important;
    min-height: 80px !important;
    padding: 0.5rem 1rem !important;
    row-gap: 0.5rem !important;
  }

  .nav-container[style*="display: none"],
  .nav-container[style*="display:none"] {
    display: none !important;
  }

  .logo {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    align-self: center !important;
  }

  .user-badge {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
    padding: 0.35rem 0.75rem !important;
    gap: 0.5rem !important;
  }

  .nav-menu-bar {
    grid-column: 1 / span 2 !important;
    grid-row: 2 !important;
    margin: 0 !important;
    width: 100% !important;
    padding-bottom: 4px !important;
  }

  /* 2. Main View & Admin Content Offsets */
  main {
    margin-top: 130px !important;
    min-height: calc(100vh - 130px) !important;
    padding: 1rem !important;
  }

  .admin-wrapper {
    margin-top: 130px !important;
    padding: 0 0.5rem !important;
  }

  .ic-wrapper {
    padding: 1rem 0.5rem !important;
  }

  /* 3. Popups and Dialogs padding */
  dialog {
    padding: 1.5rem !important;
    width: 95% !important;
  }

  /* 4. Floating Batch selector Widget */
  .floating-batch-widget {
    padding: 0.3rem 0.6rem !important;
    gap: 0.25rem !important;
    margin: 1rem auto !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  .batch-btn {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.78rem !important;
  }
}

@media (max-width: 900px) {
  /* 5. Student Internship Stacking Grid Layout Order */
  .student-internship-layout {
    grid-template-columns: 1fr !important;
  }
  .student-internship-profile-card {
    position: static !important;
    grid-row: 1 !important;
  }
  .internship-titles-container {
    grid-row: 2 !important;
  }

  /* 6. Coordinator Publish Stacking Grid Layout Order */
  .ic-publish-layout {
    grid-template-columns: 1fr !important;
  }
  .ic-publish-right {
    grid-row: 1 !important;
  }
  .ic-student-list-panel {
    grid-row: 2 !important;
  }
}
