/* The Billing Blueprint - Course Prototype Styles */
/* Teachable-inspired clean design */

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

:root {
  --primary-color: #22c55e;
  --primary-hover: #16a34a;
  --success-color: #16a34a;
  --text-dark: #202124;
  --text-medium: #5f6368;
  --text-light: #80868b;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --border-color: #e8eaed;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.logo span {
  color: var(--text-dark);
}

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

.header-nav a {
  color: var(--text-medium);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--primary-color);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Main Layout */
.main-container {
  display: flex;
  margin-top: 65px;
  min-height: calc(100vh - 65px);
}

/* Sidebar */
.sidebar {
  width: 320px;
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 65px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 1.5rem 0;
}

.course-progress {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-medium);
}

.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #86efac, #4ade80, #22c55e, #16a34a, #15803d);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Module List */
.module-list {
  padding: 1rem 0;
}

.module-item {
  margin-bottom: 0;
}

.module-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.module-header:hover {
  background: var(--bg-light);
}

.module-icon {
  width: 24px;
  height: 24px;
  margin-right: 0.75rem;
  color: var(--text-medium);
}

.module-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.module-toggle {
  color: var(--text-light);
  transition: transform 0.2s;
}

.module-item.expanded .module-toggle {
  transform: rotate(180deg);
}

/* Lesson List */
.lesson-list {
  display: none;
  padding-left: 1rem;
}

.module-item.expanded .lesson-list {
  display: block;
}

.lesson-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1.5rem;
  text-decoration: none;
  color: var(--text-medium);
  font-size: 0.875rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.lesson-item:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

.lesson-item.active {
  background: #dcfce7;
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.lesson-item.completed {
  color: var(--primary-color);
}

.lesson-status {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lesson-item.completed .lesson-status {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.lesson-item.active .lesson-status {
  border-color: var(--primary-color);
}

/* Content Area */
.content-area {
  flex: 1;
  margin-left: 320px;
  padding: 2rem;
}

/* Dashboard Styles */
.dashboard-header {
  text-align: center;
  padding: 3rem 2rem;
  background-color: #15803d;
  background-image:
    linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.25) 1px, transparent 1px);
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px;
  color: white;
  border-radius: 16px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.dashboard-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.dashboard-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.header-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.3);
}

.dashboard-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-header p {
  font-size: 1.125rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

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

.stat-card {
  background: var(--bg-white);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.stat-number {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
}

.stat-label {
  color: var(--text-medium);
  font-size: 0.8rem;
  margin-top: 0.35rem;
  font-weight: 500;
}

/* Lesson Content */
.lesson-container {
  max-width: 900px;
  margin: 0 auto;
}

.video-container {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-placeholder {
  text-align: center;
  color: #666;
}

.video-placeholder svg {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.video-placeholder p {
  font-size: 1.125rem;
}

.lesson-content {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lesson-content h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.lesson-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-medium);
  font-size: 0.875rem;
}

.lesson-description {
  margin-bottom: 2rem;
  color: var(--text-medium);
  line-height: 1.8;
}

.lesson-description h2 {
  font-size: 1.25rem;
  color: var(--text-dark);
  margin: 1.5rem 0 0.75rem;
}

.lesson-description ul, .lesson-description ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.lesson-description li {
  margin-bottom: 0.5rem;
}

/* Resources Section */
.resources-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.resources-section h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resource-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.2s;
}

.resource-item:hover {
  background: #dcfce7;
  transform: translateX(4px);
}

.resource-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 1rem;
}

.resource-info h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.resource-info p {
  font-size: 0.8rem;
  color: var(--text-medium);
}

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

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.nav-btn.primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.nav-btn.primary:hover {
  background: var(--primary-hover);
}

.complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.complete-btn:hover {
  background: #2d8a47;
  transform: scale(1.02);
}

/* Module Cards (for dashboard) */
.module-cards {
  display: grid;
  gap: 1.5rem;
}

.module-card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.2s;
}

.module-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.module-card-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), #4ade80);
  color: white;
}

.module-card-header h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.module-card-header p {
  opacity: 0.9;
  font-size: 0.875rem;
}

.module-card-body {
  padding: 1.5rem;
}

.module-card-lessons {
  list-style: none;
}

.module-card-lessons li {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-medium);
}

.module-card-lessons li:last-child {
  border-bottom: none;
}

.module-card-lessons a {
  color: var(--text-dark);
  text-decoration: none;
  flex: 1;
}

.module-card-lessons a:hover {
  color: var(--primary-color);
}

.lesson-duration {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    width: 280px;
  }
  .content-area {
    margin-left: 280px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .content-area {
    margin-left: 0;
  }
}
