:root {
    /* Light Mode (Default) */
    --primary: #4f46e5;
    --secondary: #ec4899;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #475569;
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --radius: 16px;
    --primary-glow: rgba(79, 70, 229, 0.15);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --primary-glow: rgba(99, 102, 241, 0.25);

    /* CKEditor 5 Dark Theme Variable Overrides */
    --ck-color-base-background: rgba(30, 41, 59, 0.4) !important;
    --ck-color-base-border: rgba(255, 255, 255, 0.1) !important;
    --ck-color-base-text: #f8fafc !important;
    --ck-color-base-active: #6366f1 !important;
    --ck-color-base-active-focus: #4f46e5 !important;
    
    --ck-color-toolbar-background: rgba(15, 23, 42, 0.8) !important;
    --ck-color-toolbar-border: rgba(255, 255, 255, 0.1) !important;
    
    --ck-color-button-default-background: transparent !important;
    --ck-color-button-default-hover-background: rgba(255, 255, 255, 0.08) !important;
    --ck-color-button-default-active-background: rgba(255, 255, 255, 0.15) !important;
    
    --ck-color-button-on-background: rgba(99, 102, 241, 0.2) !important;
    --ck-color-button-on-hover-background: rgba(99, 102, 241, 0.3) !important;
    --ck-color-button-on-active-background: rgba(99, 102, 241, 0.4) !important;
    --ck-color-button-on-disabled-background: rgba(255, 255, 255, 0.05) !important;
    
    --ck-color-dropdown-panel-background: #0f172a !important;
    --ck-color-dropdown-panel-border: rgba(255, 255, 255, 0.1) !important;
    
    --ck-color-list-background: #0f172a !important;
    --ck-color-list-button-hover-background: rgba(255, 255, 255, 0.08) !important;
    --ck-color-list-button-on-background: rgba(99, 102, 241, 0.2) !important;
    --ck-color-list-button-on-hover-background: rgba(99, 102, 241, 0.3) !important;
    
    --ck-color-panel-background: #0f172a !important;
    --ck-color-panel-border: rgba(255, 255, 255, 0.1) !important;
    
    --ck-color-input-background: rgba(15, 23, 42, 0.6) !important;
    --ck-color-input-border: rgba(255, 255, 255, 0.1) !important;
    --ck-color-input-text: #f8fafc !important;
    
    --ck-color-labeled-field-label-background: #0f172a !important;
}

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

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Background Gradients */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navbar */
nav {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
}

nav .nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
  color: var(--text);
}

/* Hero Section */
.hero {
  padding: 8rem 0 4rem;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  background: linear-gradient(to bottom right, #fff 30%, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

.btn-register {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* Course Section */
.paket-course {
  padding: 4rem 0;
}

.paket-course h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
}

.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.course-card {
  background: var(--surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-8px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.course-image-container {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.course-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.course-card:hover .course-image-container img {
  transform: scale(1.1);
}

.detail-link {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.course-content {
  padding: 1.5rem;
  flex-grow: 1;
}

.course-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: var(--glass);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.tag.price {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent);
  border-color: rgba(245, 158, 11, 0.2);
  margin-left: auto;
  font-weight: 700;
}

.summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-footer {
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.3);
  border-top: 1px solid var(--glass-border);
}

.course-footer .btn-follow {
  width: 100%;
}

/* Progress Bar */
.progress-container {
  margin-top: 1rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--glass);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  transition: width 0.5s ease-out;
}

/* Modal */
.login-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

.login-modal.show {
  display: flex;
  opacity: 1;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
  width: 100%;
  max-width: 440px;
  position: relative;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

@keyframes bg-pan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 3s infinite; }
.animate-slide-in { animation: slideIn 0.8s ease-out; }

.login-box h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 2rem;
  text-align: center;
}

.login-box input {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 0.875rem 1.25rem;
  border-radius: 12px;
  color: white;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.login-box input:focus {
  border-color: var(--primary);
}

.login-box button {
  width: 100%;
  margin-top: 1rem;
}

.close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .course-list { grid-template-columns: 1fr; }
}

/* Statistics Section Precision */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.75rem;
}

.stat-card p {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
}

/* CKEditor 5 Global Style Overrides */
.ck-editor {
    width: 100% !important;
    margin-bottom: 1.5rem;
    border-radius: 16px !important;
    overflow: hidden !important;
}
.ck.ck-editor__editable,
.ck.ck-editor__editable_inline {
    height: 450px !important; /* Fixed height for scrolling */
    overflow-y: auto !important; /* Enable scrolling */
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--glass-border) !important;
    border-bottom-left-radius: 16px !important;
    border-bottom-right-radius: 16px !important;
    padding: 1.5rem !important;
    font-family: inherit !important;
    transition: all 0.3s ease !important;
}
.ck.ck-editor__editable:focus,
.ck.ck-editor__editable_inline:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: inset 0 0 0 1px var(--primary), 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
}
.ck.ck-toolbar {
    background: var(--glass) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid var(--glass-border) !important;
    border-bottom: none !important;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    padding: 0.5rem !important;
}
.ck.ck-toolbar * {
    color: var(--text) !important;
    fill: var(--text) !important;
}
.ck.ck-toolbar .ck-button {
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}
.ck.ck-toolbar .ck-button:hover {
    background: rgba(120, 120, 120, 0.12) !important;
}
.ck.ck-toolbar .ck-button.ck-on {
    background: var(--primary-glow) !important;
    color: var(--primary) !important;
}
.ck.ck-toolbar .ck-button.ck-on * {
    color: var(--primary) !important;
    fill: var(--primary) !important;
}
.ck.ck-dropdown__panel {
    background: var(--surface) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}
.ck.ck-list__item:hover {
    background: rgba(120, 120, 120, 0.1) !important;
}
.ck.ck-list__item,
.ck.ck-list__item * {
    color: var(--text) !important;
    background: transparent !important;
}

/* Custom Slim Scrollbar for CKEditor */
.ck-editor__editable::-webkit-scrollbar {
    width: 8px;
}
.ck-editor__editable::-webkit-scrollbar-track {
    background: transparent;
}
.ck-editor__editable::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 120, 0.2);
    border-radius: 10px;
}
.ck-editor__editable::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.4);
}

/* Styles for rendered rich content (tables, blockquotes, images) */
.ck-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}
.ck-content table th, 
.ck-content table td {
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.25rem;
    text-align: left;
    color: var(--text);
}
.ck-content table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 700;
    color: var(--primary);
}
.ck-content table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}
.ck-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.02);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}
.ck-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
}

/* CKEditor 5 Alignment & Image Styles */
.ck-content figure {
    margin: 1.5rem 0;
}
.ck-content figure.image-style-align-left {
    float: left;
    margin-right: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
}
.ck-content figure.image-style-align-right {
    float: right;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
}
.ck-content figure.image-style-side {
    float: right;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
}
.ck-content figure.image-style-align-center {
    margin-left: auto;
    margin-right: auto;
    display: table;
}
.ck-content figure.image-style-block-align-left {
    margin-right: auto;
    margin-left: 0;
}
.ck-content figure.image-style-block-align-right {
    margin-left: auto;
    margin-right: 0;
}
.ck-content figure.image-style-block-align-center {
    margin-left: auto;
    margin-right: auto;
}
.ck-content figure.image img {
    margin: 0;
    width: 100%;
    height: auto;
}
.ck-content::after {
    content: "";
    display: table;
    clear: both;
}
