/* =====================================================================
   PORTAL PRAKTIKUM PEMROGRAMAN WEB DASAR — STMIK IKMI CIREBON
   Domain: webdasar26.designme.my.id
   Design System: Modern Glassmorphism & Cyber Tech UI (Dark & Light)
   ===================================================================== */

:root {
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Theme Tokens - Dark Mode Default */
    --bg-body: #090d16;
    --bg-header: rgba(15, 23, 42, 0.85);
    --surface-card: #0f172a;
    --surface-card-hover: #17223b;
    --surface-input: #1e293b;
    --border-color: #1e293b;
    --border-highlight: #334155;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --hero-bg: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
    --hero-glow: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);

    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
body.light-theme {
    --bg-body: #f8fafc;
    --bg-header: rgba(255, 255, 255, 0.92);
    --surface-card: #ffffff;
    --surface-card-hover: #f1f5f9;
    --surface-input: #f1f5f9;
    --border-color: #e2e8f0;
    --border-highlight: #cbd5e1;

    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;

    --hero-bg: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    --hero-glow: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.12);
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* App Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.brand-text h1 {
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.brand-text p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
    background: var(--surface-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-highlight);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.theme-toggle {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-highlight);
}

/* Hero Section */
.hero-section {
    max-width: 1400px;
    margin: 20px auto 0;
    padding: 0 24px;
}

.hero-banner {
    position: relative;
    overflow: hidden;
    background: var(--hero-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 30px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: var(--hero-glow);
    pointer-events: none;
}

.hero-tagline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: var(--text-main);
}

.hero-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    max-width: 820px;
    line-height: 1.55;
    margin-bottom: 18px;
}

/* Metrics Row */
.metrics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.metric-pill {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.metric-icon {
    font-size: 1.25rem;
}

.metric-data strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.metric-data span {
    font-size: 0.74rem;
    color: var(--text-dim);
}

/* Main Content Layout */
.main-content {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 24px;
}

/* Control Bar (Tabs & Search) */
.control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tab-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-input);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.tab-btn:hover:not(.active) {
    color: var(--text-main);
    background: var(--surface-card);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    max-width: 480px;
}

.search-box {
    position: relative;
    flex-grow: 1;
}

.search-box input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--surface-card);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Pertemuan Navigation Chips */
.pertemuan-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--surface-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: var(--surface-card-hover);
}

.chip.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

/* Section Header */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    margin-top: 28px;
}

.section-heading h2 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.section-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
}

/* Module Grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

/* Module Card */
.module-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.module-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-md);
}

.module-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.card-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.25);
    letter-spacing: 0.02em;
}

.card-tag.mysql {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.25);
}

.card-tag.security {
    background: rgba(244, 63, 94, 0.12);
    color: var(--accent-rose);
    border-color: rgba(244, 63, 94, 0.25);
}

.card-tag.mvc {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    border-color: rgba(139, 92, 246, 0.25);
}

.card-lines {
    font-size: 0.74rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
}

.module-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--text-main);
}

.module-file {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 10px;
}

.module-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.card-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Mini Project Showcase Cards */
.project-banner-card {
    background: var(--hero-bg);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.project-banner-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.project-badge {
    background: var(--accent-purple);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-block;
    margin-bottom: 12px;
}

/* Modal Source Code Viewer */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--surface-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--surface-input);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--primary);
    margin: 0;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    flex-grow: 1;
    background: #090d16;
}

body.light-theme .modal-body {
    background: #111827;
}

.modal-body pre {
    margin: 0;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* App Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 40px;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .hero-title {
        font-size: 1.4rem;
    }
    .control-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-controls {
        max-width: 100%;
    }
    .module-grid {
        grid-template-columns: 1fr;
    }
}
