/* ========================================
   KHREVISION+ MAIN STYLESHEET
   ======================================== */

:root {
  --green: #007A2F;
  --green-dark: #005220;
  --green-mid: #009A3A;
  --green-light: #E6F4EC;
  --green-accent: #00C04A;
  --black: #111111;
  --white: #FFFFFF;
  --gray-bg: #F3F7F4;
  --gray-2: #E0EBE4;
  --gray-3: #8FAA97;
  --correct: #1B6B35;
  --correct-bg: #D4EDDA;
  --incorrect: #B91C1C;
  --incorrect-bg: #FDECEA;
  --warn-bg: #FFFBEA;
  --warn: #B45309;
  --shadow: 0 2px 12px rgba(0,80,30,0.10);
  --shadow-lg: 0 6px 32px rgba(0,80,30,0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, 'Source Serif 4', sans-serif;
  background: var(--gray-bg);
  color: var(--black);
  line-height: 1.6;
  font-size: 16px;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, .site-header h1, .course-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.3rem;
}

h4 {
  font-size: 1.1rem;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.site-header {
  background: linear-gradient(120deg, #004D1C 0%, #006B2B 55%, #008C38 100%);
  color: white;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 30px;
}

.site-header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.site-header p {
  font-size: 1rem;
}

/* Navbar */
.navbar {
  background: linear-gradient(90deg, var(--green-dark), var(--green-mid));
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-title a {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
  font-family: 'Playfair Display', serif;
}

.nav-links {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 20px;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ========================================
   CONTAINERS & LAYOUT
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.course-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.course-title {
  background: linear-gradient(90deg, var(--green-dark), var(--green-mid));
  color: white;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 15px 20px;
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 20px;
}

/* Grid for cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

/* ========================================
   CARDS
   ======================================== */
.card-course {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--gray-2);
  position: relative;
}

.card-course:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-course h4 {
  font-size: 1.2rem;
  color: var(--green-dark);
  margin-bottom: 10px;
  font-weight: 800;
}

.card-course p {
  color: var(--gray-3);
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.card-course a {
  display: inline-block;
  background: var(--green);
  color: white;
  padding: 8px 18px;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.85rem;
}

.card-course a:hover {
  background: var(--green-dark);
}

.card-course.locked {
  opacity: 0.7;
}

.card-course.locked::after {
  content: "🔒";
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 18px;
}

/* ========================================
   FORMS
   ======================================== */
input, select, textarea {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 2px solid var(--gray-2);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
}

button, .btn {
  background: var(--green);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover, .btn:hover {
  background: var(--green-dark);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
  padding: 12px;
  margin: 15px 0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}

.alert.success {
  background: var(--correct-bg);
  color: var(--correct);
  border: 1px solid var(--correct);
}

.alert.warning {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
}

.alert.error {
  background: var(--incorrect-bg);
  color: var(--incorrect);
  border: 1px solid var(--incorrect);
}

/* ========================================
   MEMBERSHIP CARD
   ======================================== */
.welcome-card {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white;
  padding: 30px;
  border-radius: var(--radius);
  margin-bottom: 30px;
}

.welcome-card h2 {
  margin: 0 0 10px 0;
  font-size: 1.6rem;
}

.welcome-card p {
  font-size: 0.95rem;
}

.membership-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--green);
}

.membership-badge {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
}

.badge-active { background: var(--correct); color: white; }
.badge-pending { background: var(--warn); color: white; }
.badge-expired { background: var(--incorrect); color: white; }
.badge-free { background: var(--green); color: white; }
.badge-single { background: #e67e22; color: white; }
.badge-admin { background: #9b59b6; color: white; }

.membership-info {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
}

/* ========================================
   STATS GRID
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-2);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--green-dark);
}

.stat-label {
  color: var(--gray-3);
  margin-top: 5px;
  font-size: 0.85rem;
}

/* ========================================
   UPGRADE PROMPT
   ======================================== */
.upgrade-prompt {
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 0.9rem;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  background: var(--green-dark);
  color: white;
  text-align: center;
  padding: 35px 20px;
  margin-top: 48px;
}

footer h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

footer p {
  font-size: 0.85rem;
  opacity: 0.8;
}

.f-divider {
  width: 60px;
  height: 3px;
  background: var(--green-accent);
  border-radius: 2px;
  margin: 12px auto;
}

/* ========================================
   DASHBOARD SPECIFIC STYLES
   ======================================== */
.curriculum-section {
  margin-bottom: 40px;
}
.curriculum-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white;
  padding: 15px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.curriculum-header h2 {
  margin: 0;
  font-size: 1.3rem;
}
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  background: white;
  border: 2px solid var(--gray-2);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px;
}
.subject-card {
  background: var(--gray-bg);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--gray-2);
}
.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.subject-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.subject-card h3 {
  color: var(--green-dark);
  margin-bottom: 8px;
  font-size: 1.1rem;
}
.subject-description {
  color: var(--gray-3);
  font-size: 0.85rem;
  margin-bottom: 15px;
  line-height: 1.5;
}
.subject-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-2);
  font-size: 0.8rem;
}
.lesson-count {
  color: var(--green);
  font-weight: bold;
}
.free-count {
  color: var(--gray-3);
}
.progress-bar-small {
  background: var(--gray-2);
  border-radius: 10px;
  height: 6px;
  margin: 10px 0;
  overflow: hidden;
}
.progress-fill-small {
  background: var(--green);
  height: 100%;
  border-radius: 10px;
  width: 0%;
}
.btn-start {
  display: inline-block;
  background: var(--green);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
}
.btn-start:hover {
  background: var(--green-dark);
}
.btn-locked {
  background: var(--gray-3);
  cursor: not-allowed;
}
.empty-subjects {
  text-align: center;
  padding: 40px;
  color: var(--gray-3);
}
.curriculum-note {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 20px;
  text-align: center;
  color: var(--green-dark);
  font-size: 0.9rem;
}
.single-subject-note {
  background: #fff3cd;
  border-left: 4px solid #e67e22;
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 5px;
  font-size: 0.85rem;
}
.admin-view-badge {
  background: #9b59b6;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  margin-left: 10px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 15px;
  }
  
  .nav-links {
    justify-content: center;
  }
  
  .nav-title a {
    font-size: 1.3rem;
  }
  
  .nav-links a {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
  
  .site-header h1 {
    font-size: 1.5rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .welcome-card h2 {
    font-size: 1.3rem;
  }
  
  .course-title {
    font-size: 1.1rem;
  }
  
  .subjects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .course-section {
    padding: 10px;
  }
  
  .card-course {
    padding: 15px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .curriculum-header h2 {
    font-size: 1rem;
  }
}

/* ========================================
   LESSON PAGE STYLES
   ======================================== */
.lesson-content {
  background: white;
  border-radius: var(--radius);
  padding: 25px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.lesson-content h1, .lesson-content h2 {
  color: var(--green-dark);
  margin-bottom: 20px;
}

.lesson-content h3 {
  color: var(--green-mid);
  margin: 20px 0 10px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
  text-align: center;
}

.text-green {
  color: var(--green);
}

.bg-green-light {
  background: var(--green-light);
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.p-20 {
  padding: 20px;
}

/* Navbar special buttons */
.admin-btn { background: #9b59b6 !important; }
.pending-btn { background: #f39c12 !important; }
.upgrade-btn { background: #e67e22 !important; }
.renew-btn { background: #e74c3c !important; }
.premium-btn { background: #27ae60 !important; }