@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap');

#typing-text{
    font-family: 'Poppins', sans-serif;
}

.cursor{
    font-family: 'Poppins', sans-serif;
}

/* --- VARIABEL WARNA --- */
:root {
    --bg-color: #f4f7f6;
    --text-color: #333333;
    --text-muted: #666666;
    --primary-color: #a81b1b;
    --secondary-color: #f8f9fa;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --border-color: #e9ecef;
    --nav-bg: #ffffff;
}

.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --text-muted: #aaaaaa;
    --primary-color: #4cc9f0;
    --secondary-color: #1e1e1e;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 6px rgba(255, 255, 255, 0.05);
    --border-color: #333333;
    --nav-bg: #1e1e1e;
}

/* --- PENGATURAN DASAR --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* --- NAVIGASI (TAB MENU) --- */
nav {
    width: 100%;
    padding: 1rem 5%;
    background-color: var(--nav-bg);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Baris atas untuk mengatur Logo di kiri dan Tombol Dark Mode di kanan */
.nav-header-mobile {
    display: contents;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    grid-column: 1;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    grid-column: 2;
}

.nav-links li {
    cursor: pointer;
    list-style: none;
}

.tab-link {
    font-weight: 500;
    padding: 5px 10px;
    transition: color 0.3s;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-color);
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.tab-link:hover, .tab-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    grid-column: 3;
    justify-self: end;
}

/* --- LAYOUT UTAMA --- */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 5%;
}

.tab-content {
    display: none;
    width: 100%;
    max-width: 1000px;
    animation: fadeIn 0.5s ease-out forwards;
}

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

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

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* --- HOME SECTION --- */
#home {
    text-align: center;
}

.profile-home {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

#home h1 { 
    font-size: 3rem; 
    margin-bottom: 10px; 
}

#home p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 20px; }

.cursor {
    color: var(--primary-color);
    font-weight: bold;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.social-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1.3rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, color 0.3s;
}

.social-buttons a:hover { transform: translateY(-5px); }
.social-buttons a:hover.fa-linkedin { color: #0077b5; }
.social-buttons a:hover.fa-tiktok { color: #000000; }
.social-buttons a:hover.fa-youtube { color: #ff0000; }
.social-buttons a:hover.fa-instagram { color: #e1306c; }
.dark-mode .social-buttons a:hover.fa-tiktok { color: #ffffff; }

/* --- PROYEK SECTION --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border-top: 4px solid var(--primary-color);
    transition: transform 0.3s;
}

.project-card:hover { transform: translateY(-5px); }
.project-card h3 { margin-bottom: 10px; color: var(--primary-color); }
.project-card p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 15px; }

.btn-small {
    display: inline-block;
    padding: 8px 15px;
    font-size: 0.9rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: background 0.3s;
}
.btn-small:hover { background-color: var(--border-color); }

/* --- ABOUT ME --- */
.about-container {
    display: flex;
    align-items: center;
    gap: 40px;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: var(--card-shadow);
}

.about-text { flex: 1; }
.about-text p { margin-bottom: 20px; font-size: 1.05rem; }

.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: #fff !important;
    border-radius: 5px;
    font-weight: bold;
    transition: transform 0.2s;
    border: none;
    cursor: pointer;
}
.btn:hover { transform: translateY(-3px); filter: brightness(1.1); }

/* --- PENDIDIKAN --- */
.edu-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    border-left: 5px solid var(--primary-color);
    margin-bottom: 20px;
}
.edu-year { font-size: 0.9rem; color: var(--primary-color); font-weight: bold; margin-bottom: 10px; display: block; }

/* --- CONTACT --- */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px; border: 1px solid var(--border-color);
    border-radius: 5px; background-color: var(--bg-color); color: var(--text-color);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.btn-submit { width: 100%; border: none; font-size: 1rem; }

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 20px;
    background-color: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- NAVIGASI (TAB MENU) --- */
nav {
    width: 100%;
    padding: 1rem 5%;
    background-color: var(--nav-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-header-mobile {
    display: contents; /* Tidak mengubah struktur asli di PC */
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-links li {
    cursor: pointer;
    list-style: none;
}

.tab-link {
    font-weight: 500;
    padding: 5px 10px;
    transition: color 0.3s;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-color);
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.tab-link:hover, .tab-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    margin-left: 10px;
}

@media (max-width: 768px) {
    /* Perbaikan Section About */
    .about-container { 
        flex-direction: column; 
        text-align: center; 
        padding: 20px;
        gap: 20px;
    }

    .profile-img {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
    
    /* Navigasi HP diatur menggunakan Flexbox Wrap */
    nav { 
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px; 
        gap: 10px;
    }

    /* Logo di kiri atas */
    .logo {
        font-size: 1.2rem;
        order: 1;
    }

    /* Tombol Tema di kanan atas */
    #theme-toggle {
        font-size: 1.1rem;
        margin-left: 0;
        order: 2;
    }

    /* Menu Tab dipaksa pindah ke baris bawah dan tersusun rapi di tengah */
    .nav-links { 
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center; 
        gap: 6px; 
        width: 100%;
        order: 3;
        margin-top: 5px;
    }

    .tab-link {
        font-size: 0.85rem;
        padding: 4px 8px;
    }

    #home h1 {
      font-family: 'Poppins', sans-serif;
        font-size: 1rem; 
    }
}