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

:root {
  --primary-color: #4F46E5; /* Indigo */
  --secondary-color: #818CF8;
  --bg-color: #f3f4f6;
  --card-bg: #ffffff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --bs-font-sans-serif: 'Inter', sans-serif;
  --navbar-height: 70px;
}

body {
  background-color: var(--bg-color);
  font-family: var(--bs-font-sans-serif);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

/* Scrollbar styling for desktop */
body::-webkit-scrollbar {
  width: 8px;
}
body::-webkit-scrollbar-track {
  background: var(--bg-color);
}
body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* -------------------------------------------------------------
   MOBILE APP VIEW STYLES (< 768px)
------------------------------------------------------------- */
@media (max-width: 767.98px) {
  body {
    height: 100vh;
    overflow: hidden; /* App wrapper will scroll */
  }
  .app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  /* Content Area */
  .app-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-top: 76px; /* Space for top header */
    padding-bottom: 90px; /* Space for bottom nav */
    -webkit-overflow-scrolling: touch;
  }
  /* Scrollbar hiding for app feel */
  .app-content::-webkit-scrollbar {
    width: 0px;
    background: transparent;
  }
  .desktop-navbar {
    display: none !important;
  }
  /* detail page mobile adjust */
  .detail-img-container {
    margin: -16px -16px 20px -16px; 
    height: 280px; 
    position: relative;
  }
  .detail-content-pb {
    padding-bottom: 100px; /* Space for sticky mobile button */
  }
}

/* -------------------------------------------------------------
   DESKTOP VIEW STYLES (>= 768px)
------------------------------------------------------------- */
@media (min-width: 768px) {
  body {
    height: auto;
    overflow-y: auto;
  }
  .app-container {
    min-height: 100vh;
    padding-top: var(--navbar-height);
  }
  .app-content {
    /* No absolute padding needed, handled by container class */
  }
  .app-header {
    display: none !important; /* Hide mobile top bar */
  }
  .bottom-nav {
    display: none !important; /* Hide mobile bottom nav */
  }
  .mobile-bottom-cta {
    display: none !important; /* Hide sticky mobile register cta */
  }
  /* Detail page layout diff */
  .detail-img-container {
    height: 400px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
  }
  .detail-content-pb {
    padding-bottom: 40px;
  }
}

/* -------------------------------------------------------------
   COMMON: MOBILE HEADER & BOTTOM NAV
------------------------------------------------------------- */
.app-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1000;
}
.app-header .title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-dark);
  margin: 0;
}
.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-dark);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  text-decoration: none;
}
.icon-btn:hover, .icon-btn:active {
  background: rgba(0,0,0,0.05);
  color: var(--text-dark);
}

.bottom-nav {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  z-index: 1000;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 12px;
  border-radius: 12px;
  flex: 1;
}
.nav-item i {
  font-size: 1.4rem;
  transition: transform 0.2s;
}
.nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 2px;
}
.nav-item.active {
  color: var(--primary-color);
}
.nav-item.active i {
  transform: translateY(-2px);
  font-weight: bold;
}

/* -------------------------------------------------------------
   COMMON: NAVBAR DESKTOP
------------------------------------------------------------- */
.desktop-navbar {
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
}
.desktop-navbar .navbar-brand {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.4rem;
}
.desktop-navbar .nav-link {
  font-weight: 500;
  color: var(--text-dark);
  padding: 8px 16px;
  transition: color 0.2s;
}
.desktop-navbar .nav-link:hover, .desktop-navbar .nav-link.active {
  color: var(--primary-color);
}

/* -------------------------------------------------------------
   COMMON: SEMINAR CARDS
------------------------------------------------------------- */
.seminar-card {
  background: var(--card-bg);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
  margin-bottom: 20px;
  border: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.seminar-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}
.seminar-img-wrapper {
  position: relative;
  height: 200px;
  cursor: pointer;
}
.seminar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.seminar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,0.7));
}
.badge-quota {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-color);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.seminar-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.seminar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.3;
  cursor: pointer;
  transition: color 0.2s;
}
.seminar-title:hover {
  color: var(--primary-color);
}
.seminar-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.seminar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.seminar-meta > div {
  display: flex;
  align-items: center;
  gap: 6px;
}
.seminar-meta i {
  color: var(--primary-color);
  font-size: 1rem;
}

/* Progress bar inside card */
.quota-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}
.quota-info span.muted {
  color: var(--text-muted);
  font-weight: 500;
}
.quota-progress {
  height: 6px;
  background-color: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}
.quota-progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 10px;
}

/* -------------------------------------------------------------
   APP BUTTONS & COMPONENTS
------------------------------------------------------------- */
.btn-app {
  border-radius: 100px;
  padding: 14px 24px;
  font-weight: 600;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  font-size: 0.95rem;
}
.btn-primary-app {
  background: var(--primary-color);
  border: none;
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}
.btn-primary-app:hover, .btn-primary-app:active {
  background: #4338ca;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}
.btn-secondary-app {
  background: #f3f4f6;
  border: none;
  color: var(--text-dark);
}
.btn-secondary-app:hover, .btn-secondary-app:active {
  background: #e5e7eb;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title a {
  font-size: 0.85rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

/* Detail page curve overlay */
.detail-radius-overlay {
  position: absolute; 
  bottom: 0; 
  width: 100%; 
  height: 24px; 
  background: var(--bg-color); 
  border-top-left-radius: 24px; 
  border-top-right-radius: 24px;
}
@media (min-width: 768px) {
  .detail-radius-overlay {
    display: none;
  }
}

/* Form Styles */
.form-group {
    position: relative;
    margin-bottom: 24px;
}
.form-label-floating {
    position: absolute;
    top: 0;
    left: 0;
    padding: 16px 20px;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
}
.form-control-app {
    width: 100%;
    padding: 24px 20px 8px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 1rem;
    background: #f9fafb;
    transition: all 0.2s;
}
.form-control-app:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}
.form-control-app:focus ~ .form-label-floating,
.form-control-app:not(:placeholder-shown) ~ .form-label-floating {
    transform: translateY(-8px) scale(0.85);
    color: var(--primary-color);
    transform-origin: 0 0;
}
.invalid-feedback-app {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 6px;
    margin-left: 10px;
    display: none;
}
.form-control-app.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}
.form-control-app.is-invalid ~ .invalid-feedback-app {
    display: block;
}
