@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #0ea5e9;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --correct-bg: #f0fdf4;
    --correct-border: #22c55e;
    --correct-text: #166534;
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0.03) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.03) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.03) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
header {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(241, 245, 249, 0.8);
    padding: 0.3rem;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Main Content Area */
main {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Top Actions (Print) */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.print-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.print-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.print-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
}

.q-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.q-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.q-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    padding-top: 0.2rem;
}

.code-block {
    display: inline-block;
    background: #f1f5f9;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    color: #be123c;
    font-size: 0.9em;
    border: 1px solid #e2e8f0;
}

.options {
    margin-left: 3.75rem;
    margin-bottom: 1.5rem;
}

.option {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(248, 250, 252, 0.5);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.option:hover {
    background: var(--primary-light);
}

.answer-section {
    margin-left: 3.75rem;
    background-color: var(--correct-bg);
    border-left: 4px solid var(--correct-border);
    padding: 1.25rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.answer-title {
    font-weight: 700;
    color: var(--correct-text);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explanation {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Tugas Specific Styles */
.tugas-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.status-wajib { background: #fee2e2; color: #b91c1c; }
.status-opsional { background: #e0e7ff; color: #4338ca; }

.tugas-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
    background: transparent;
}

/* Print Styles */
@media print {
    body { background: white; }
    header, .nav-tabs, .print-btn, footer { display: none !important; }
    main { padding: 0; }
    .card {
        box-shadow: none;
        border: 1px solid #cbd5e1;
        break-inside: avoid;
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }
    .q-number {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .answer-section {
        background-color: #f8fafc !important;
        border-left: 4px solid var(--correct-border) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-container { flex-direction: column; text-align: center; }
    .nav-tabs { width: 100%; overflow-x: auto; justify-content: center; }
    .q-header { gap: 1rem; }
    .options, .answer-section { margin-left: 0; margin-top: 1rem; }
    main { padding: 2rem 1rem; }
}
