/* === BASE STYLES & VARIABLES (Light Theme) === */
:root {
    --bg-color: #f8fafc;
    --surface: #ffffff;
    --surface-alt: #f1f5f9;

    --text-main: #0f172a;
    --text-muted: #475569;

    --accent: #10b981;
    --accent-hover: #059669;

    --border-color: #e2e8f0;

    --bot-bubble: #dcfce7;
    --user-bubble: #e2e8f0;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);

    --glow: 0 0 12px rgba(16, 185, 129, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Montserrat', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(145deg, #f9fafb 0%, #f1f5f9 100%);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@keyframes aurora {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(300px, 200px);
    }
}

body::before {
    content: '';
    position: fixed;
    width: 700px;
    height: 700px;
    top: -200px;
    left: -200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08), transparent 70%);
    filter: blur(120px);
    animation: aurora 15s infinite alternate;
    pointer-events: none;
    opacity: 0.6;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

.card,
.mbti-card,
.message {
    animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === NAVBAR (Light) === */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--text-main);
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    margin-left: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

/* === BUTTONS (Light) === */
.btn {
    padding: 12px 25px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    border: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(16, 185, 129, 0.05);
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.85rem;
}

/* === HOME & PORTFOLIO === */
.hero {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

@keyframes floatHero {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero h1 {
    animation: floatHero 5s ease-in-out infinite;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(90deg, #0f172a, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 30px;
}

.server-status {
    font-family: monospace;
    background: #f1f5f9;
    padding: 8px 15px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

section {
    padding: 80px 50px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    border-left: 4px solid var(--accent);
    padding-left: 15px;
    color: var(--text-main);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.card p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.card a.card-link {
    color: var(--accent);
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.card a.card-link:hover {
    text-decoration: underline;
}

/* === PSYCHOLOGY AI (Light bubbles) === */
.psych-header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: white;
    position: relative;
}

.psych-header h1 {
    font-size: 1.5rem;
    color: var(--text-main);
}

.psych-header h1 span {
    color: var(--accent);
}

.psych-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.psych-header .back-link {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
}

.chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.message {
    max-width: 80%;
    padding: 15px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bot-msg {
    background: #dcfce7;
    color: #14532d;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #bbf7d0;
}

.user-msg {
    background: #e2e8f0;
    color: #0f172a;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    border: 1px solid #cbd5e1;
}

.input-area {
    background-color: white;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.input-wrapper {
    max-width: 800px;
    width: 100%;
    display: flex;
    gap: 10px;
}

.input-wrapper input[type="text"] {
    flex: 1;
    padding: 15px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    background-color: #f9fafb;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
}

.input-wrapper input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.input-wrapper button:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

.loading {
    font-style: italic;
    color: var(--accent);
    font-size: 0.9rem;
    display: none;
    align-self: flex-start;
    margin: 0 auto 10px auto;
    max-width: 800px;
    width: 100%;
    padding-left: 20px;
}

/* === MBTI TEST (Light) === */
.mbti-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    width: 100%;
}

.mbti-header {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--text-main);
}

.mbti-card {
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background-color: white;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.mbti-question {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
}

.mbti-question span {
    color: var(--accent);
    font-weight: bold;
    font-size: 1.4rem;
    margin-right: 10px;
}

.mbti-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.mbti-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 60px;
    padding: 12px 20px;
    transition: 0.3s;
    flex: 1;
    min-width: 120px;
    background-color: #f9fafb;
}

.mbti-label:hover {
    background-color: #f1f5f9;
    border-color: var(--accent);
}

.mbti-radio {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: var(--accent);
    cursor: pointer;
}

.mbti-label span {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-main);
}

.btn-mbti {
    width: 100%;
    padding: 15px;
    font-size: 1.25rem;
    border-radius: 60px;
    margin-top: 20px;
}

.mbti-result-card {
    padding: 40px;
    border: 1px solid var(--border-color);
    border-radius: 32px;
    background-color: white;
    box-shadow: var(--shadow-md);
}

.mbti-result-type {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    text-align: center;
    margin-bottom: 10px;
}

.mbti-result-title {
    font-size: 1.5rem;
    text-align: center;
    font-weight: bold;
    margin-bottom: 40px;
    color: var(--text-main);
}

.mbti-result-section {
    margin-bottom: 25px;
}

.mbti-result-section h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.mbti-result-section p {
    color: var(--text-muted);
}

.mbti-result-section ul {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--text-muted);
}

.btn-mbti-reload {
    width: 100%;
    padding: 15px;
    border-radius: 60px;
    margin-top: 30px;
}

/* === FOOTER (Light) === */
footer {
    text-align: center;
    padding: 40px 20px;
    background-color: white;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

footer span {
    color: var(--accent);
}

/* === PERBAIKAN MBTI RESULT CARD (Agar teks jelas & card rapi) === */

/* Pastikan card memiliki latar solid dan kontras tinggi */
.mbti-result-card {
    background: #ffffff !important;      /* putih solid, tidak tembus pandang */
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 40px 30px;
    box-shadow: var(--shadow-md);
    margin: 30px 0;
}

/* Semua teks di dalam card menggunakan warna gelap yang terbaca */
.mbti-result-card,
.mbti-result-card * {
    color: var(--text-main);    /* #0f172a, sangat gelap */
}

/* Kecuali elemen dengan kelas khusus tetap gunakan warna muted */
.mbti-result-section p,
.mbti-result-section li,
.mbti-result-section span:not(.highlight) {
    color: var(--text-muted) !important;   /* #475569, tetap terbaca */
}

/* Type MBTI (misal: INTJ) - aksen hijau, tetap kontras */
.mbti-result-type {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent) !important;       /* #10b981, jelas */
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

/* Judul kepribadian (misal: "Sang Visioner") */
.mbti-result-title {
    font-size: 1.8rem;
    text-align: center;
    font-weight: bold;
    margin-bottom: 30px;
    color: var(--text-main) !important;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 8px;
}

/* Setiap section (Deskripsi, Kekuatan, Kelemahan) */
.mbti-result-section {
    margin-bottom: 28px;
    background: var(--surface-alt);   /* #f1f5f9, abu sangat muda */
    padding: 18px 22px;
    border-radius: 24px;
    transition: all 0.2s;
}

.mbti-result-section h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mbti-result-section h4::before {
    content: "▹";
    color: var(--accent);
    font-size: 1.2rem;
}

/* Paragraf deskripsi */
.mbti-result-section p {
    line-height: 1.6;
    font-size: 1rem;
}

/* Daftar (kekuatan/kelemahan) */
.mbti-result-section ul {
    margin: 10px 0 0 20px;
    padding-left: 0;
}

.mbti-result-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Tombol ulang test */
.btn-mbti-reload {
    background: var(--accent);
    color: white !important;
    border: none;
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 60px;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 30px;
}

.btn-mbti-reload:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Perbaikan untuk tampilan mobile */
@media (max-width: 768px) {
    .mbti-result-card {
        padding: 25px 18px;
    }
    .mbti-result-type {
        font-size: 2.5rem;
    }
    .mbti-result-title {
        font-size: 1.3rem;
    }
    .mbti-result-section {
        padding: 14px 16px;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero .btn {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        font-size: 0.95rem;
        padding: 12px 15px;
    }
    nav {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }
    .nav-links a {
        margin-left: 10px;
        margin-right: 10px;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    section {
        padding: 50px 20px;
    }
    .mbti-options {
        flex-direction: column;
    }
    .psych-header .back-link {
        position: static;
        display: inline-block;
        margin-bottom: 10px;
        transform: none;
    }
}