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

:root {
  --bg-dark: #f8fafc;
  --bg-panel: #ffffff;
  --bg-hover: #f1f5f9;
  --primary: #1e3a8a;
  --primary-glow: rgba(30, 58, 138, 0.08);
  --secondary: #0284c7;
  --accent: #d97706;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --border-focus: #3b82f6;
  --gradient: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
  --gradient-hover: linear-gradient(135deg, #0284c7 0%, #1e3a8a 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-dark);
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(30, 58, 138, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(2, 132, 199, 0.04) 0%, transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

@keyframes glowPulse {
  0% { box-shadow: 0 0 5px var(--primary-glow); }
  50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
  100% { box-shadow: 0 0 5px var(--primary-glow); }
}

.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Header & Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand i {
  font-size: 2.2rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.btn-nav {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

/* Main Layout */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Glassmorphism Panel / Card */
.card-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(30, 41, 59, 0.05);
  margin-bottom: 2rem;
}

/* Buttons */
.btn-primary {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: var(--text-secondary);
}

.btn-danger {
  background: #dc2626;
  border: none;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Books Grid & Cards */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.book-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
}

.book-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.book-cover-container {
  aspect-ratio: 3/4;
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.book-card:hover .book-cover {
  transform: scale(1.05);
}

.book-badge-grade {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 2;
}

.book-badge-subject {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(11, 8, 19, 0.85);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  z-index: 2;
}

.book-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  /* Line clamp */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: auto;
  display: flex;
  justify-content: space-between;
}

/* Badges */
.badge-jenjang {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #b45309;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Tables styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.custom-table th {
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.custom-table td {
  padding: 1rem;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.custom-table tr:hover {
  background: rgba(255,255,255,0.01);
}

/* PDF Reader Page */
.reader-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 65px);
  overflow: hidden;
}

.reader-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.reader-viewer {
  background: #1e1e24;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Landing Page Hero */
.hero-section {
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 30%, var(--primary) 70%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.login-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Footer */
footer {
  background: rgba(11, 8, 19, 0.9);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .reader-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
  }
  .reader-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .reader-viewer {
    height: 600px;
  }
}

/* Institutional Profile Sections styling */
.profile-hero {
  position: relative;
  padding: 10rem 2rem 8rem 2rem;
  text-align: center;
  background-image: linear-gradient(135deg, rgba(10, 31, 61, 0.4) 0%, rgba(15, 23, 42, 0.5) 100%), url('../images/hero_clear_symbols.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
  width: 100%;
  margin: 0;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.profile-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg-dark), transparent);
  pointer-events: none;
}

.profile-hero-logo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 25px rgba(201, 164, 76, 0.35);
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
}

.profile-section {
  padding: 5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 3rem;
  align-items: center;
}

.vision-mission-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.accreditation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #047857;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.stat-card {
  background: rgba(22, 18, 36, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--secondary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 0.5rem;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.branch-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.branch-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(139,92,246,0.15);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.testimonial-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 4rem;
  color: rgba(255,255,255,0.05);
  line-height: 1;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  padding: 1.25rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  padding: 0 1.25rem 1.25rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.map-container {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  height: 350px;
}

/* Mobile responsive layout fixes */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-align: center;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
  }
  .nav-link {
    font-size: 0.85rem;
  }
  .btn-nav {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
  .profile-hero {
    padding: 6rem 1rem 4rem 1rem !important;
    background-position: right bottom !important;
  }
  .hero-main-title {
    font-size: 2.2rem !important;
  }
  .hero-main-tagline {
    font-size: 1.3rem !important;
  }
  .hero-main-desc {
    font-size: 0.95rem !important;
  }
  .profile-section {
    padding: 3rem 1rem !important;
  }
  .section-title {
    font-size: 1.8rem !important;
  }
  .section-subtitle {
    margin-bottom: 2rem !important;
  }
  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .branch-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .testimonial-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

