/* ===== VARIABLES ===== */
:root {
    --text-primary: #4c4d52;
    --text-hover: #0099ff;
    --bg-primary: #f2f2f2;
    --bg-card: #fafafa;
    --bg-navbar: #fafafa;
    --border-color: #e5e5e5;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --transition: all 0.2s ease;
}

/* ===== BASE RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: #6c757d;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--text-hover);
}

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

.main {
    min-height: 100vh;
}

.main.with-navbar {
    min-height: calc(100vh - 60px);
    margin-top: 60px;
}

.section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--text-hover);
    border-radius: 2px;
}

.section-title div {
    color: #6c757d;
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.hero h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.hero h1 span {
    color: var(--text-hover);
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #6c757d;
    max-width: 500px;
}

.btn-get-started {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 1.75rem;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-get-started:hover {
    background: var(--text-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-watch-video {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 1.75rem;
    background: transparent;
    color: var(--text-primary);
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    text-decoration: none;
}

.btn-watch-video:hover {
    color: var(--text-hover);
    border-color: var(--text-hover);
    transform: translateY(-2px);
}

/* ===== FEATURES SECTION ===== */
.icon-box {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    height: 100%;
    text-align: center;
}

.icon-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--text-hover);
}

.icon-box i {
    font-size: 2.5rem;
    color: var(--text-hover);
    margin-bottom: 1rem;
    display: block;
}

.icon-box h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.icon-box p {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* ===== MODULS SECTION ===== */
.modul-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    height: 100%;
}

.modul-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--text-hover);
}

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

.modul-card h5 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.modul-card p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.modul-btn {
    background: var(--text-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    display: inline-block;
}

.modul-btn:hover {
    background: var(--text-hover);
    color: white;
    transform: translateY(-1px);
}

.modul-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modul-card .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.modul-card .modul-btn {
    margin-top: auto;
}

.badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}

/* ===== STATS SECTION ===== */
.stats-item {
    text-align: center;
    padding: 1.5rem;
}

.stats-item i {
    font-size: 2.5rem;
    color: var(--text-hover);
    margin-bottom: 1rem;
}

.stats-item span {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stats-item p {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* ===== CTA SECTION ===== */
.cta {
    text-align: center;
    padding: 4rem 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.cta h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.cta p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== UTILITIES ===== */
.light-background {
    background: var(--bg-primary);
}

.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-3 {
    gap: 1rem;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* Scroll top button */
#scroll-top {
    position: fixed;
    right: 1.5rem;
    bottom: 80px;
    width: 40px;
    height: 40px;
    background: var(--text-primary);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
}

#scroll-top.show {
    opacity: 1;
    visibility: visible;
}

#scroll-top:hover {
    background: var(--text-hover);
    transform: translateY(-2px);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: none;
}

/* ===== PAGE HERO (Untuk halaman spesifik) ===== */
.page-hero {
    padding: 3rem 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.page-hero .hero-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.page-hero .hero-subtitle {
    font-size: 1rem;
    color: #6c757d;
    max-width: 600px;
}

.modul-stats {
    display: inline-block;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ===== MODULS LIST PAGE ===== */
.moduls-section {
    padding: 2rem 0;
}

.modul-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    height: 100%;
    overflow: hidden;
}

.modul-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--text-hover);
}

/* Image container */
.card-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--text-hover) 0%, #0077cc 100%);
    color: white;
}

.card-img-placeholder i {
    font-size: 2.5rem;
}

/* Card body */
.modul-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.modul-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.modul-submoduls {
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-text {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Progress section - simplified */
.progress-section {
    margin: 1rem 0;
}

.progress-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.modul-progress {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.modul-progress-fill {
    height: 100%;
    background-color: var(--text-hover);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-percentage {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-hover);
}

/* Action button */
.modul-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.modul-btn:hover {
    background: var(--text-hover);
    color: white;
    transform: translateY(-1px);
}

/* Completed state */
.modul-complete .modul-progress .progress-bar {
    background-color: #28a745;
}

.modul-complete .progress-percentage {
    color: #28a745;
}

/* Empty state */
.empty-state {
    padding: 4rem 1rem;
    text-align: center;
}

.empty-state i {
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: #6c757d;
    max-width: 400px;
    margin: 0 auto;
}

.discuss-section {
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin-top: 2.5rem;
}

/* Card Header */
.discuss-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.discuss-header h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.discuss-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    opacity: 0.9;
}

/* Question Form - Minimalis */
.ask-question-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.ask-question-card:hover {
    border-color: var(--text-hover);
}

.question-form {
    padding: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* TinyMCE Custom Styling */
.tox-tinymce {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border-color) !important;
    margin-bottom: 1rem;
}

.tox-toolbar__primary {
    background: #f8f9fa !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* Questions List */
.questions-list {
    margin-top: 2rem;
}

.question-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.question-item:hover {
    box-shadow: var(--shadow);
    border-color: #e0e0e0;
}

.question-content {
    padding: 1.25rem;
    border-bottom: 1px solid var(--bg-primary);
}

/* User Avatar - Minimal */
.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--text-hover) 0%, #0077cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
}

/* Question Text Styling */
.question-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 1rem 0;
}

.question-text p {
    margin-bottom: 0.75rem;
}

.question-text img,
.answer-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-text img:hover,
.answer-text img:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.question-text iframe,
.answer-text iframe {
    width: 100%;
    max-width: 650px;
    height: 400px;
    border-radius: 8px;
    margin: 15px 0;
    border: none;
}

.question-text video,
.answer-text video {
    width: 100%;
    max-width: 650px;
    border-radius: 8px;
    margin: 15px 0;
    background: #000;
}

/* Style untuk media caption */
.question-text figure,
.answer-text figure {
    margin: 15px 0;
    text-align: center;
}

.question-text figcaption,
.answer-text figcaption {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Blender-specific media */
.blender-screenshot {
    border: 1px solid #e5e5e5;
}

.blender-video-tutorial {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.blender-video-tutorial iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Action Buttons */
.action-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--bg-primary);
    border-color: var(--text-hover);
    color: var(--text-hover);
}

.action-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Answer Section */
.answer-section {
    background: #fafafa;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1rem 1.25rem;
}

.answers-list {
    margin-top: 1rem;
}

.answer-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.answer-item:last-child {
    margin-bottom: 0;
}

.answer-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #495057;
    margin: 0.75rem 0;
}

/* Empty State */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* File Upload Styling */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
}

.file-upload-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-label:hover {
    background: #e9ecef;
    border-color: var(--text-hover);
}

/* =========================
   PROFILE PAGE
========================= */

.profile-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-title {
    font-weight: 600;
}

.profile-info label {
    font-size: 14px;
    color: #6c757d;
}

.profile-actions .btn {
    min-width: 120px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 767px) {
    .page-hero {
        padding: 2rem 0;
        text-align: center;
    }

    .page-hero .row {
        flex-direction: column;
        gap: 1.5rem;
    }

    .modul-stats {
        display: block;
        max-width: 200px;
        margin: 0 auto;
    }

    .modul-card {
        margin-bottom: 1rem;
    }

    .card-image {
        height: 140px;
    }
}


/* Tablet */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }

    .section {
        padding: 4rem 0;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2.75rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .stats-item span {
        font-size: 2.5rem;
    }

    .moduls-section {
        padding: 3rem 0;
    }

    .page-hero {
        padding: 4rem 0;
    }

    .page-hero .hero-title {
        font-size: 2rem;
    }

    .discuss-section {
        margin-top: 1.5rem;
    }

    .question-form,
    .question-content {
        padding: 1rem;
    }

    .tox-tinymce {
        border-radius: 0.375rem !important;
    }

    .question-text iframe,
    .answer-text iframe,
    .question-text video,
    .answer-text video {
        max-width: 100%;
        height: 250px;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }

    .section {
        padding: 5rem 0;
    }

    .hero {
        padding: 6rem 0;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .icon-box {
        padding: 2.5rem;
    }

    .cta {
        padding: 5rem 0;
    }

    .moduls-section {
        padding: 4rem 0;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .section {
        padding: 2.5rem 0;
    }

    .hero {
        padding: 3rem 0;
        text-align: center;
    }

    .hero .row {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        margin-left: auto;
        margin-right: auto;
    }

    .d-flex.flex-wrap {
        justify-content: center;
    }

    .stats-item {
        padding: 1rem;
    }

    .stats-item span {
        font-size: 1.75rem;
    }

    #scroll-top {
        right: 1rem;
        bottom: 1rem;
        width: 36px;
        height: 36px;
    }
}

/* Very small mobile */
@media (max-width: 375px) {
    .container {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .btn-get-started,
    .btn-watch-video {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}