:root {
  --sidebar-width: 280px;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --pd-text-color: rgb(245, 246, 247);
  --sidebar-bg: #ffffff;
  --sidebar-hover: rgba(0, 0, 0, 0.04);
  --sidebar-active: rgba(99, 102, 241, 0.08);
  --sidebar-border: rgba(0, 0, 0, 0.08);
  --main-bg: #f1f5f9;
  --card-bg: #ffffff;
  --card-hover: #f8fafc;
  --card-border: rgba(0, 0, 0, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #000000;
  --text-light: #fff;
  --text-muted: #000000;
}

[data-bs-theme="dark"] {
  --sidebar-bg: #0a0e17;
  --sidebar-hover: rgba(255, 255, 255, 0.04);
  --sidebar-active: rgba(99, 102, 241, 0.12);
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --main-bg: #0f1320;
  --card-bg: #151a2e;
  --card-hover: #1a2038;
  --card-border: rgba(255, 255, 255, 0.06);
  --text-primary: #f1f5f9;
  --text-secondary: #FFFFFF;
  --text-muted: #ffffff;
}

@keyframes cardAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes listAppear {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes typeCode {
  to {
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
  }
}

@keyframes blinkBlock {
  50% {
    opacity: 0;
  }
}

.hide {
  display: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--main-bg);
  color: var(--text-primary);
  overflow-x: hidden;
}

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

.sidebar-toggle {
  display: flex;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
  width: 42px;
  height: 42px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle:hover {
  background: var(--card-hover);
  border-color: var(--accent);
}

@media (min-width: 992px) {
  .sidebar-toggle {
    display: none;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  transition: opacity var(--transition);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100%;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 1099;
  transition: transform var(--transition), background 0.4s ease, border-color 0.4s ease;
  overflow: hidden;
  transform: translateX(-100%);
}

@media (min-width: 992px) {
  .sidebar {
    transform: translateX(0);
  }
}

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

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--accent-glow), transparent);
  opacity: 0.5;
}

.sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 10px;
  flex-shrink: 0;
  position: relative;
  justify-content: center;
}

.sidebar .sidebar-brand .brand-logo {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  position: relative;
}

.sidebar .sidebar-brand .brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

.sidebar .sidebar-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 20px 15px;
  flex-shrink: 0;
}

.sidebar .sidebar-clock .clock-time {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px var(--accent-glow);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.sidebar .sidebar-clock .clock-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 0.5px;
  transition: color 0.4s ease;
}

.sidebar .sidebar-search {
  padding: 0 16px 16px;
  flex-shrink: 0;
}

.sidebar .sidebar-search .search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar .sidebar-search .search-wrapper i {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.4s ease;
}

.sidebar .sidebar-search .search-wrapper input {
  width: 100%;
  background: var(--sidebar-hover);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  padding: 10px 40px 10px 36px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.4s ease;
  outline: none;
  font-family: inherit;
}

.sidebar .sidebar-search .search-wrapper input:focus {
  background: var(--sidebar-hover);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.sidebar .sidebar-search .search-wrapper input::placeholder {
  color: var(--text-muted);
}

.sidebar .sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
  padding-bottom: 30px;
}

.sidebar .sidebar-nav .nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 20px 8px 8px;
  text-transform: uppercase;
  transition: color 0.4s ease;
}

.sidebar .sidebar-nav .nav-label:first-child {
  padding-top: 4px;
}

.quick-links-container {
  position: relative;
  z-index: 10;
  margin-bottom: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

@media (min-width: 768px) {
  .quick-links-container {
    justify-content: unset;
  }
}

.main-content {
  margin-left: 0;
  padding: 80px 20px 32px;
  position: relative;
  transition: background 0.4s ease;
  min-height: 100vh;
}

@media (min-width: 992px) {
  .main-content {
    padding: 32px 40px;
    margin-left: var(--sidebar-width);
  }
}

.main-content::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.main-content .page-meta {
  pointer-events: none;
}

.main-content .page-meta .page-view-count {
  margin-bottom: 5px;
}

@media (min-width: 576px) {
  .main-content .page-meta .page-view-count {
    margin-bottom: 0;
  }
}

.main-content .bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(99, 102, 241, 0.2) 1px, transparent 1px), linear-gradient(90deg, rgba(99, 102, 241, 0.2) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 10%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 75%);
  transform: translateZ(0);
}

.main-content .news-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.main-content .news-category i {
  margin-right: 3px;
}

.main-content .news-category.update {
  background: #e3f2fd;
  color: #1976d2;
}

.main-content .news-category.news {
  background: #1F51FF;
  color: #FFFFFF;
}

.main-content .news-category.alert {
  background: #fff3e0;
  color: #e65100;
}

.main-content .news-category.maintenance {
  background: #fce4ec;
  color: #c2185b;
}

.main-content .topbar {
  margin-bottom: 32px;
  position: relative;
}

.main-content .topbar .page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  transition: color 0.4s ease;
}

@media (min-width: 768px) {
  .main-content .topbar .page-title {
    font-size: 28px;
  }
}

.main-content .topbar .page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  transition: color 0.4s ease;
}

.main-content .category {
  display: none;
}

.main-content .category.active {
  display: block;
}

.main-content .category .app-container {
  position: relative;
  z-index: 1;
}

.main-content .category .app-container .app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

@media (min-width: 768px) {
  .main-content .category .app-container .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
}

@media (min-width: 992px) {
  .main-content .category .app-container .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
}

.main-content .category .app-container .app-grid .app-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  opacity: 0;
  transform: translateY(20px);
  animation: cardAppear 0.5s forwards;
}

@media (min-width: 768px) {
  .main-content .category .app-container .app-grid .app-card {
    padding: 35px 20px;
  }
}

.main-content .category .app-container .app-grid .app-card .app-icon {
  width: 48px;
  height: 48px;
  font-size: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .main-content .category .app-container .app-grid .app-card .app-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
    border-radius: 14px;
  }
}

.main-content .category .app-container .app-grid .app-card .app-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  background: inherit;
  opacity: 0;
  filter: blur(12px);
  z-index: -1;
  transition: opacity 0.35s ease;
}

.main-content .category .app-container .app-grid .app-card .app-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  transition: color 0.4s ease;
}

.main-content .category .app-container .app-grid .app-card .app-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.4s ease;
}

.main-content .category .app-container .app-grid .app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.main-content .category .app-container .app-grid .app-card:hover {
  transform: translateY(-4px);
  border-color: #006eff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.08);
  background: var(--card-hover);
}

.main-content .category .app-container .app-grid .app-card:hover .app-icon {
  transform: scale(1.1);
}

.main-content .category .app-container .app-grid .app-card:hover .app-icon::after {
  opacity: 1;
}

.main-content .category .app-container #search-results-grid .app-card {
  animation: none !important;
  opacity: 1;
  transform: none !important;
}

.main-content .category .app-container #search-results-grid .app-card:hover {
  transform: none !important;
}

.full-content .exam-clock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.full-content .exam-clock .clock-time {
  width: 100%;
  text-align: center;
  font-size: clamp(1.5rem, 19vw, 20rem);
  font-variant-numeric: tabular-nums;
}

.full-content .exam-clock .clock-date {
  width: 100%;
  text-align: center;
  font-size: clamp(1.5rem, 6vw, 10rem);
}

.code-typewriter {
  display: none;
  align-items: center;
  font-family: 'Cascadia Code', 'Cascadia Mono', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  justify-content: center;
  margin-bottom: 10px;
}

@media (min-width: 768px) {
  .code-typewriter {
    display: flex;
  }
}

.code-typewriter .code-prompt {
  flex-shrink: 0;
  color: #22c55e;
  margin-right: 8px;
  text-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.code-typewriter .code-typed {
  display: inline-block;
  vertical-align: middle;
  clip-path: inset(0 100% 0 0);
  -webkit-clip-path: inset(0 100% 0 0);
  animation: typeCode 4s steps(50, end) forwards;
  animation-delay: 0.5s;
}

.code-typewriter .code-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: #22c55e;
  margin-left: 4px;
  vertical-align: middle;
  transform: translateZ(0);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  animation: blinkBlock 0.8s step-end infinite;
  flex-shrink: 0;
}

.news-dropdown {
  background: transparent;
  padding: 0;
  border-radius: 16px;
  border: none;
}

.colour-mode-dropdown .skm-dropdown {
  background-color: #31015c;
  padding: 1em;
}

.colour-mode-dropdown .skm-dropdown .dropdown-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-bottom: 2em;
  align-items: center;
}

.colour-mode-dropdown .dropdown-arrow {
  background-color: #31015c;
}

.colour-mode-dropdown .appearance-row {
  display: flex;
  flex-direction: row;
  width: 170px;
  align-items: center;
  justify-content: space-between;
}

.colour-mode-dropdown .appearance-row:nth-child(2) {
  margin-bottom: 18px;
}

.colour-mode-dropdown .appearance-row span {
  display: block;
  font-size: 13px;
  margin-right: 10px;
}

.school-maps-dropdown .skm-dropdown {
  background-color: #050a36;
  padding: 1em;
}

.school-maps-dropdown .skm-dropdown .dropdown-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-bottom: 2em;
  align-items: center;
}

.school-maps-dropdown .skm-dropdown .nav-link {
  color: #fff;
}

.site-list-dropdown .skm-dropdown {
  background-color: #050a36;
  padding: 1em;
}

.site-list-dropdown .skm-dropdown .dropdown-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-bottom: 2em;
  align-items: center;
}

.site-list-dropdown .skm-dropdown .nav-link {
  color: #fff;
}

@media (min-width: 992px) {
  .knowledge-base-dialog, .phone-directory-dialog {
    transform: scale(0.75);
    overflow: hidden;
  }
}

@media (min-width: 1600px) {
  .knowledge-base-dialog, .phone-directory-dialog {
    transform: scale(1);
    overflow: hidden;
  }
}

.phone-directory-dialog .skm-dialog-body {
  padding: 0px;
}

.phone-directory-dialog .skm-dialog-body .pd-container .phone-directory-content {
  height: 500px;
  overflow-y: auto;
  padding: 5px;
}

.phone-directory-dialog .skm-dialog-body .pd-container .phone-directory-content .card {
  margin-bottom: 1rem;
}

.phone-directory-dialog .skm-dialog-body .pd-container .phone-directory-search {
  width: 280px;
  margin: 1em auto;
}

.kb-container .knowledge-base-content {
  height: 500px;
  overflow-y: auto;
  padding: 5px;
}

.kb-container .knowledge-base-content .card {
  margin-bottom: 1rem;
}

.kb-container .knowledge-base-content .card a {
  color: #fff !important;
}

.kb-container .knowledge-base-search {
  width: 280px;
  margin: 1em auto;
}

#summerwork .subject-container {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

#summerwork .subject-container .subject {
  width: 140px;
  height: 140px;
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.5s ease;
  position: relative;
  margin: 1rem;
  overflow: hidden;
  background: #8ac0ff;
  background: linear-gradient(160deg, #1cb5e0 0%, #000851 100%);
  box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(255, 255, 255, 0.3) 0px 30px 60px -30px, rgba(10, 37, 64, 0.35) 0px -2px 6px 0px inset;
  padding: 8px;
  text-align: center;
}

#summerwork .subject-container .subject:hover {
  transform: scale(1.1);
}

#summerwork .subject-container .subject .subject-icon {
  width: 50px;
  height: 50px;
  fill: white;
  transform: translateZ(0);
}

#summerwork .subject-container .subject .subject-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  text-align: center;
}

@media (min-width: 992px) {
  #summerwork .subject-container .subject {
    width: 150px;
    height: 150px;
  }
}

.login-card {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.micrsoft-login .logo {
  float: left;
}

.micrsoft-login .logo img {
  width: 50px;
  height: 50px;
}

.micrsoft-login .title {
  float: left;
  padding: 0.7em 0 0 1em;
}

[data-bs-theme="dark"] .syntax-keyword {
  color: #c678dd;
}

[data-bs-theme="dark"] .syntax-var {
  color: #61afef;
}

[data-bs-theme="dark"] .syntax-op {
  color: #abb2bf;
}

[data-bs-theme="dark"] .syntax-string {
  color: #98c379;
}

[data-bs-theme="dark"] .syntax-punc {
  color: #abb2bf;
}

[data-bs-theme="light"] #site-list-button {
  color: var(--text-secondary);
}

[data-bs-theme="light"] #site-list-button:hover {
  color: var(--card-bg);
}

[data-bs-theme="light"] .main-content::before {
  opacity: 0.08;
}

[data-bs-theme="light"] .colour-mode-dropdown, [data-bs-theme="light"] .school-maps-dropdown, [data-bs-theme="light"] .site-list-dropdown {
  color: var(--text-light);
}

[data-bs-theme="light"] .app-card::before {
  background: linear-gradient(135deg, transparent 40%, rgba(0, 0, 0, 0.01));
}

[data-bs-theme="light"] .app-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

[data-bs-theme="light"] .bg-grid {
  background-image: linear-gradient(rgba(65, 105, 225, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(65, 105, 225, 0.1) 1px, transparent 1px);
}

[data-bs-theme="light"] .syntax-keyword {
  color: #a626a4;
}

[data-bs-theme="light"] .syntax-var {
  color: #0184bc;
}

[data-bs-theme="light"] .syntax-op {
  color: #383a42;
}

[data-bs-theme="light"] .syntax-string {
  color: #50a14f;
}

[data-bs-theme="light"] .syntax-punc {
  color: #383a42;
}

[data-bs-theme="light"] .code-prompt {
  color: #50a14f;
  text-shadow: none;
}

[data-bs-theme="light"] .code-cursor {
  background: #50a14f;
  box-shadow: none;
}
