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

:root {
  --gray: #1F2937;
  --gray-light: #6B7280;
  --gray-lighter: #F9FAFB;
  --mint: #10B981;
  --mint-light: #D1FAE5;
  --hexTeal: #97D7C3;
  --logoMain: #4A5568;
  --logoAccent: #ff8000;
  --white: #FFFFFF;
  --accent: #8B5CF6;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --border-color: #E5E7EB;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  transition: all 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
}

.main-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  color: var(--gray);
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--mint);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* Docs Container */
.docs-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  margin-top: 70px;
  min-height: calc(100vh - 70px - 100px);
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  background: var(--gray-lighter);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 2rem 1.5rem;
}

.sidebar-header {
  margin-bottom: 1.5rem;
}

.sidebar-header h3 {
  font-size: 1.25rem;
  color: var(--gray);
}

/* Search */
.search-container {
  position: relative;
  margin-bottom: 2rem;
}

#docs-search {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

#docs-search:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

/* Sidebar Navigation */
.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.nav-section h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-light);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.nav-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-section a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--gray);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.nav-section a:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--mint);
}

.nav-section a.active {
  background: var(--mint);
  color: white;
  font-weight: 500;
}

/* Subsections */
.nav-section .subsection {
  margin-left: 0.5rem;
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border-color);
  display: none; /* Hidden by default */
}

/* Show subsections when parent link is active OR when parent li has active-parent class */
.nav-section a.active + .subsection,
.nav-section li.active-parent > .subsection {
  display: block;
}

.nav-section .subsection li {
  margin-bottom: 0.25rem;
}

.nav-section .subsection a {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}

.nav-section .subsection a:hover {
  color: var(--mint);
}

/* Main Content */
.docs-content {
  padding: 3rem 4rem;
  /* Grid automatically handles positioning, no margin-left needed */
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--gray-light);
}

.breadcrumb a {
  color: var(--mint);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .separator {
  color: var(--gray-light);
}

/* Article Styles */
article {
  max-width: 1200px; /* Constrain text width for readability */
  width: 100%;
}

article h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gray);
  margin-bottom: 1rem;
  line-height: 1.2;
}

article h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--gray);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

article h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gray);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

article h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--gray-light);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

article p {
  margin-bottom: 1rem;
  color: var(--gray);
}

article ul,
article ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

article li {
  margin-bottom: 0.5rem;
  color: var(--gray);
}

article code {
  background: var(--gray-lighter);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
  color: var(--logoAccent);
}

article pre {
  background: var(--gray);
  color: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

article pre code {
  background: none;
  padding: 0;
  color: var(--white);
}

/* Quick Links Grid */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
}

.quick-link-card {
  background: var(--white);
  border: 2px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-link-card:hover {
  border-color: var(--mint);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
}

.card-icon-svg {
  width: 50px;
  height: 50px;
  fill: #10b981;
}

.student-schedule-icon {
  fill: #ff8000;
}

.quick-link-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--gray);
}

.quick-link-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gray-light);
}

/* Section Divider */
.section-divider {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 3rem 0;
}

/* Update Card */
.update-card {
  background: linear-gradient(135deg, rgba(151, 215, 195, 0.1), rgba(144, 202, 249, 0.1));
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid var(--mint);
  position: relative;
  margin: 1.5rem 0;
}

.update-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--mint);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.update-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.update-card ul {
  margin-left: 1.5rem;
  margin-bottom: 0;
}

/* Help Options */
.help-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.help-card {
  background: var(--gray-lighter);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.help-card h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.help-card p {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--gray-light);
}

.help-link {
  color: var(--mint);
  text-decoration: none;
  font-weight: 500;
}

.help-link:hover {
  text-decoration: underline;
}

/* Feedback Section */
.feedback-section {
  background: var(--gray-lighter);
  padding: 2rem;
  border-radius: 12px;
  margin-top: 3rem;
  text-align: center;
}

.feedback-section h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.feedback-section p {
  margin-bottom: 1.5rem;
  color: var(--gray-light);
}

.feedback-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.feedback-btn {
  background: white;
  border: 2px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.feedback-btn:hover {
  border-color: var(--mint);
  background: var(--mint-light);
}

/* Page Navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.page-nav-prev,
.page-nav-next {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 45%;
}

.page-nav-next {
  align-items: flex-end;
  text-align: right;
}

.page-nav-label {
  font-size: 0.85rem;
  color: var(--gray-light);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.page-nav-link {
  font-size: 1.1rem;
  color: var(--mint);
  text-decoration: none;
  font-weight: 500;
}

.page-nav-link:hover {
  text-decoration: underline;
}

/* Callout Boxes */
.callout {
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.callout-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3B82F6;
}

.callout-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: #F59E0B;
}

.callout-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--mint);
}

.callout-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: #EF4444;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Footer */
footer {
  background: var(--gray);
  color: white;
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

footer a {
  color: var(--mint);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .docs-container {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .docs-content {
    margin-left: 0;
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  .main-nav {
    display: none;
  }

  .docs-content {
    padding: 1.5rem 1rem;
  }

  article h1 {
    font-size: 2rem;
  }

  article h2 {
    font-size: 1.5rem;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
  }

  .help-options {
    grid-template-columns: 1fr;
  }

  .page-nav {
    flex-direction: column;
    gap: 2rem;
  }

  .page-nav-prev,
  .page-nav-next {
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
  }
}

/* Scrollbar Styling */
.docs-sidebar::-webkit-scrollbar {
  width: 8px;
}

.docs-sidebar::-webkit-scrollbar-track {
  background: var(--gray-lighter);
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-light);
}

/* Search Results Dropdown */
.search-container {
  position: relative;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 0.5rem;
}

.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: #f9fafb;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: #1f2937;
}

.search-result-keyword {
  font-size: 0.85rem;
  color: #10b981;
  font-weight: 500;
  margin-bottom: 0.15rem;
  text-transform: capitalize;
}

.search-result-section {
  font-size: 0.85rem;
  color: #6b7280;
}

.search-result-item mark {
  background-color: #d1fae5;
  color: #065f46;
  padding: 0.1rem 0.2rem;
  border-radius: 2px;
  font-weight: 600;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Scrollbar styling for search results */
.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
