/* ==========================================================================
   Dr. Bed Prasad Dhakal - Educational Website Stylesheet
   Compatible with Cloudflare Pages Direct Folder Upload
   Includes styles for Navigation, Blocks, Courses, PDFs tab & Download Records
   ========================================================================== */

:root {
  --primary: #114669;
  --primary-hover: #0c334d;
  --secondary: #42CBDB;
  --accent-red: #B84030;
  --accent-orange: #E6A10E;
  --accent-yellow: #F0BC0D;
  --bg-light: #F3F8FC;
  --bg-subtle: #f8fafc;
  --text-dark: #212529;
  --text-muted: #6c757d;
  --border-color: #e2e8f0;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --hover-shadow: 0 10px 24px rgba(17, 70, 105, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background-color: #ffffff;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #1f78b9;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Top Bar (Contacts & Socials)
   -------------------------------------------------------------------------- */
#top-bar {
  background-color: var(--bg-light);
  border-bottom: 1px solid #e1ebf4;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  color: #4a5568;
}

.top-info-item {
  display: inline-flex;
  align-items: center;
  margin-right: 1.25rem;
  color: #4a5568;
}

.top-info-item i {
  color: var(--primary);
  margin-right: 0.4rem;
  font-size: 0.9rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  margin-left: 0.35rem;
  font-size: 0.85rem;
  border: 1px solid #dbe6ef;
  transition: all 0.2s ease;
}

.social-links a:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Main Navigation Bar
   -------------------------------------------------------------------------- */
#main-navbar {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0.6rem 0;
}

.navbar-brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-link {
  font-weight: 500;
  color: #2d3748 !important;
  padding: 0.55rem 0.85rem !important;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-link:hover, .nav-item.active .nav-link {
  color: var(--primary) !important;
  background-color: var(--bg-light);
}

.nav-link.tab-highlight {
  background: linear-gradient(135deg, rgba(17, 70, 105, 0.08), rgba(66, 203, 219, 0.15));
  border: 1px solid rgba(66, 203, 219, 0.4);
  font-weight: 600;
  color: var(--primary) !important;
}

.nav-link.tab-highlight:hover {
  background: linear-gradient(135deg, var(--primary), #1a6291);
  color: #ffffff !important;
  border-color: transparent;
}

.nav-link.tab-highlight i {
  color: var(--accent-orange);
}

.nav-link.tab-highlight:hover i {
  color: #fff;
}

/* Dropdown styling */
.dropdown-menu {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: #374151;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background-color: var(--bg-light);
  color: var(--primary);
  padding-left: 1.25rem;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
#hero-section {
  position: relative;
  background: linear-gradient(135deg, #0d3854 0%, #17547d 60%, #1e6d9e 100%);
  color: #ffffff;
  padding: 3.5rem 0 3rem;
  overflow: hidden;
}

#hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(66, 203, 219, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(240, 188, 13, 0.12) 0%, transparent 40%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #42CBDB;
  border: 1px solid rgba(66, 203, 219, 0.3);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.8rem;
  line-height: 1.15;
}

.hero-desc {
  font-size: 1.1rem;
  opacity: 0.92;
  font-weight: 300;
  max-width: 680px;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-btn {
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.75rem;
  margin-bottom: 0.5rem;
}

.hero-btn-primary {
  background-color: var(--secondary);
  color: #0c334d;
  box-shadow: 0 4px 14px rgba(66, 203, 219, 0.35);
}

.hero-btn-primary:hover {
  background-color: #38b8c7;
  color: #0c334d;
  transform: translateY(-2px);
}

.hero-btn-outline {
  background-color: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.hero-btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: #ffffff;
}

/* --------------------------------------------------------------------------
   Blocks Menu (Icon Quick Links from Original Template)
   -------------------------------------------------------------------------- */
#blocks-menu {
  margin-top: -2rem;
  position: relative;
  z-index: 10;
  margin-bottom: 2.5rem;
}

.block-card {
  padding: 1.4rem 1rem;
  color: #ffffff;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 110px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  text-decoration: none !important;
}

.block-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  color: #ffffff;
}

.block-card i {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.block-card span {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
}

.block-1 { background-color: #114669; }
.block-2 { background-color: #42CBDB; color: #0c334d !important; }
.block-2 i, .block-2 span { color: #0c334d !important; }
.block-3 { background-color: #B84030; }
.block-4 { background-color: #BD4E3F; }
.block-5 { background-color: #E6A10E; }

/* --------------------------------------------------------------------------
   Tab Navigation & Panes
   -------------------------------------------------------------------------- */
.tab-content-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content-pane.active {
  display: block;
}

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

/* --------------------------------------------------------------------------
   Section Headers
   -------------------------------------------------------------------------- */
.section-header {
  margin-bottom: 2rem;
  position: relative;
}

.section-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary);
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
  display: block;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-divider {
  width: 50px;
  height: 4px;
  background-color: var(--secondary);
  border-radius: 2px;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Course Cards Grid
   -------------------------------------------------------------------------- */
.course-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 1.3rem;
  margin-bottom: 1.5rem;
  transition: all 0.25s ease;
  height: calc(100% - 1.5rem);
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
  border-color: rgba(66, 203, 219, 0.5);
}

.course-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.course-icon-blue { background: rgba(17, 70, 105, 0.1); color: var(--primary); }
.course-icon-teal { background: rgba(66, 203, 219, 0.15); color: #0099ad; }
.course-icon-red { background: rgba(184, 64, 48, 0.1); color: var(--accent-red); }
.course-icon-orange { background: rgba(230, 161, 14, 0.12); color: var(--accent-orange); }

.course-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.course-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   PDFs Tab Section
   -------------------------------------------------------------------------- */
.pdf-portal-hero {
  background: linear-gradient(135deg, #f0f7fc 0%, #e8f4fb 100%);
  border: 1px solid #d8e9f5;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.pdf-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pdf-filter-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdf-filter-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.pdf-filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.search-input-wrap input {
  padding-left: 2.5rem;
  border-radius: 50px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.95rem;
}

.search-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 70, 105, 0.15);
}

.pdf-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  height: calc(100% - 1.5rem);
  position: relative;
}

.pdf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(17, 70, 105, 0.09);
  border-color: #cbd5e1;
}

.pdf-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.pdf-icon {
  width: 48px;
  height: 48px;
  background: #fff1f0;
  border: 1px solid #ffccc7;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cf1322;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.pdf-meta {
  flex-grow: 1;
}

.pdf-tag {
  display: inline-block;
  background: var(--bg-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.pdf-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.35;
}

.pdf-desc {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 1.2rem;
  flex-grow: 1;
  line-height: 1.5;
}

.pdf-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px dashed #e2e8f0;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}

.download-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.2rem 0.55rem;
  border-radius: 50px;
  font-weight: 600;
}

.download-badge i {
  color: #059669;
}

.file-size-badge {
  color: #64748b;
  font-weight: 500;
}

.pdf-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-download-pdf {
  flex-grow: 1;
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-download-pdf:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
}

.btn-preview-pdf {
  background-color: #f1f5f9;
  color: #334155;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preview-pdf:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* --------------------------------------------------------------------------
   Download Records / Tracking Tab
   -------------------------------------------------------------------------- */
.records-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: transform 0.2s ease;
}

.records-kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.kpi-icon-blue { background: #e0f2fe; color: #0284c7; }
.kpi-icon-green { background: #dcfce7; color: #16a34a; }
.kpi-icon-purple { background: #f3e8ff; color: #9333ea; }
.kpi-icon-orange { background: #ffedd5; color: #ea580c; }

.kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 0.2rem;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.records-table-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 2rem;
}

.records-table-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background-color: #fafbfc;
}

.records-table-header h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.table-custom {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}

.table-custom th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table-custom td {
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.table-custom tr:hover td {
  background-color: #f8fafc;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-success {
  background: #dcfce7;
  color: #15803d;
}

/* --------------------------------------------------------------------------
   Sidebar & Widgets
   -------------------------------------------------------------------------- */
.sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--card-shadow);
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.widget-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 35px;
  height: 3px;
  background-color: var(--secondary);
  border-radius: 2px;
}

.popular-post-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.popular-post-item:last-child {
  border-bottom: none;
}

.post-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.custom-toast {
  background: #1e293b;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  max-width: 360px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--secondary);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
#footer {
  background-color: #0b2538;
  color: #cbd5e1;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  font-size: 0.9rem;
}

#footer h5 {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

#footer h5::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 2px;
  background-color: var(--secondary);
}

#footer a {
  color: #94a3b8;
}

#footer a:hover {
  color: #ffffff;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.9rem;
  }
  .block-card {
    min-height: 90px;
    margin-bottom: 0.5rem;
  }
  .records-table-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
