/* =========================================
   Variabel CSS (Design Tokens)
   ========================================= */
:root {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --transition: all 0.3s ease;
}

/* =========================================
   Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
}

/* =========================================
   Navbar & Mobile Menu
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
    z-index: 100; /* Keep logo di atas overlay pada keadaan tertentu jika dibutuhkan */
}

/* Hamburger Button */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
}

/* Hamburger Active Animation (Silang) */
.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Nav Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Nav Links Mobile (Sidebar UI) */
.nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    background-color: var(--bg-color);
    padding: 80px 2rem 2rem;
    box-shadow: var(--shadow-lg);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.nav-links.active {
    right: 0;
}

.nav-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.1rem;
    transition: var(--transition);
    display: block;
    padding: 0.5rem 0;
}

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

/* Nav Links Desktop */
@media (min-width: 768px) {
    .hamburger {
        display: none;
    }
    
    .nav-overlay {
        display: none !important;
    }
    
    .nav-links {
        position: static;
        width: auto;
        max-width: none;
        height: auto;
        background-color: transparent;
        padding: 0;
        box-shadow: none;
        transition: none;
    }
    
    .nav-links ul {
        flex-direction: row;
        gap: 2rem;
    }
    
    .nav-links a {
        font-size: 0.95rem;
        padding: 0;
    }
}

/* =========================================
   1. Hero Section
   ========================================= */
.hero {
    padding: 120px 0 60px; /* Reduced padding for mobile */
    text-align: center;
    background-color: var(--bg-alt);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-title {
    font-size: 2rem; /* Scaled down for mobile */
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    letter-spacing: -0.025em;
}

.hero-title span {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.hero-buttons .btn {
    width: 100%; /* Full width buttons on mobile */
    max-width: 300px;
}

@media (min-width: 640px) {
    .hero { padding: 160px 0 100px; }
    .hero-title { font-size: 3.5rem; margin-bottom: 1.5rem; }
    .hero-subtitle { font-size: 1.25rem; margin-bottom: 2.5rem; }
    .hero-buttons { flex-direction: row; }
    .hero-buttons .btn { width: auto; }
}

/* Tombol Global */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: white;
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background-color: var(--bg-alt);
    transform: translateY(-2px);
}

/* =========================================
   2. Tentang DTP Programmer
   ========================================= */
.about {
    padding: 100px 0;
    background-color: var(--bg-color);
}

.about-text {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.8;
}

/* =========================================
   3. Timeline Pembelajaran
   ========================================= */
.timeline {
    padding: 60px 0; /* Reduced for mobile */
    background-color: var(--bg-alt);
}

.timeline-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem; /* Reduced for mobile */
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .timeline-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.timeline-card {
    background-color: var(--bg-color);
    border-radius: 1rem;
    padding: 1.5rem; /* Reduced for mobile */
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .timeline { padding: 100px 0; }
    .timeline-grid { gap: 2rem; }
    .timeline-card { padding: 2.5rem; }
}

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

.timeline-icon {
    width: 3.5rem;
    height: 3.5rem;
    background-color: var(--bg-alt);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border: 2px solid var(--primary-color);
}

.timeline-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.timeline-list {
    list-style: none;
}

.timeline-list li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    color: var(--text-muted);
}

.timeline-list-icon {
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    object-fit: contain;
}

/* =========================================
   4. Showcase Projects & Materies
   ========================================= */
.showcase {
    padding: 60px 0; /* Reduced for mobile */
    background-color: var(--bg-color);
}

.showcase-category {
    margin-bottom: 3rem; /* Reduced for mobile */
}

.showcase-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 1.25rem; /* Reduced for mobile */
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem; /* Reduced for mobile */
}

@media (min-width: 640px) {
    .showcase { padding: 100px 0; }
    .showcase-category { margin-bottom: 4rem; }
    .category-title { font-size: 1.5rem; margin-bottom: 2rem; }
    .project-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
}

@media (min-width: 1024px) {
    .project-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Template Card */
.project-card {
    background-color: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.project-image {
    width: 100%;
    height: 220px;
    padding: 0.5rem;
    object-fit: contain;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.5s ease;
    cursor: pointer;
}

.project-card:hover .project-image {
    transform: scale(1.05); /* Sedikit zoom pada gambar saat di hover */
}

.project-image-wrapper {
    overflow: hidden;
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    position: relative; /* Menjaga content di atas efek zoom image */
    z-index: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-badges {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.badge-type {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-project {
    background-color: #dbeafe;
    color: #2563eb;
}

.badge-materi {
    background-color: #f3e8ff;
    color: #9333ea;
}

.project-badge {
    background-color: #ffedd5; /* Light orange background */
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-badge {
    background-color: var(--bg-alt);
    color: var(--text-muted);
    padding: 0.25rem 0.6rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

.project-actions {
    display: flex;
    flex-direction: column; /* Stack buttons on mobile */
    gap: 0.75rem;
    margin-top: auto;
}

@media (min-width: 480px) {
    .project-actions {
        flex-direction: row; /* Side by side on slightly larger screens */
        gap: 1rem;
    }
}

.project-btn {
    flex: 1;
    text-align: center;
    padding: 0.6rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-demo {
    background-color: var(--bg-alt);
    color: var(--text-color);
    border: 1px solid transparent;
}

.btn-github {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

/* Hover Effect Pada Card */
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* Perubahan warna tombol saat card di-hover */
.project-card:hover .btn-demo {
    background-color: var(--primary-color);
    color: white;
}

.project-card:hover .btn-github {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* =========================================
   5. Footer
   ========================================= */
.footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 5rem 0 2rem;
}

.footer-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    font-weight: 600;
}

.footer-bottom {
    color: var(--text-muted);
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

/* =========================================
   Animasi (Fade In pada Scroll)
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   Modal Popup
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 1rem;
    padding: 2rem;
    position: relative;
    border: 1px solid var(--border-color);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-2xl);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-close {
    position: absolute;
    top: 1rem; right: 1.5rem;
    font-size: 2rem;
    background: none; border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--primary-color);
}
.modal-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    padding-right: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.modal-body {
    color: var(--text-muted);
}
.btn-popup {
    width: 100%;
    margin-bottom: 1rem;
    background-color: var(--bg-alt);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}
.btn-popup:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* =========================================
   Lightbox Popup
   ========================================= */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 0.5rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}
.lightbox-close {
    position: absolute;
    top: 1.5rem; right: 2.5rem;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 3001;
}
.lightbox-close:hover {
    color: var(--primary-color);
}
