/* --- ⚪ 1. GLOBAL VARIABLES (SYSTEM LIGHT & DARK THEME) --- */
:root {
    --bg-primary: #f8fafc; 
    --bg-surface: rgba(255, 255, 255, 0.95);
    --bg-card: #ffffff;
    --bg-project-card: #f8fafc;
    --text-main: #1e293b; 
    --text-title: #0f172a;
    --text-muted: #475569;
    --text-sub: #64748b;
    --border-color: #e2e8f0;
    --border-about: #f1f5f9;
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: rgba(2, 132, 199, 0.08);
    --primary-badge: rgba(2, 132, 199, 0.1);
    --shadow-sm: rgba(0,0,0,0.02);
    --shadow-hover: rgba(0,0,0,0.04);
}

.dark-mode {
    --bg-primary: #0f172a; 
    --bg-surface: rgba(30, 41, 59, 0.95);
    --bg-card: #1e293b;
    --bg-project-card: #151f32;
    --text-main: #cbd5e1; 
    --text-title: #f8fafc;
    --text-muted: #94a3b8;
    --text-sub: #64748b;
    --border-color: #334155;
    --border-about: #1e293b;
    --primary-hover: #38bdf8;
    --primary-light: rgba(56, 189, 248, 0.15);
    --primary-badge: rgba(56, 189, 248, 0.15);
    --shadow-sm: rgba(0,0,0,0.2);
    --shadow-hover: rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary); 
    color: var(--text-main); 
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.section-container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 5rem 0;
}

.section-title {
    font-size: 2.2rem;
    color: var(--text-title);
    margin-bottom: 1rem;
    position: relative;
    font-weight: 800;
}

.section-title.text-center::after {
    content: ''; display: block; width: 50px; height: 4px; background: var(--primary-color); margin: 10px auto 0 auto; border-radius: 2px;
}

.text-center { text-align: center; }

/* --- 🌐 2. NAVIGATION BAR & THEME BUTTON --- */
header {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
}

.logo {
    color: var(--text-title);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

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

.nav-right-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    cursor: pointer;
}

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

.nav-btn {
    background-color: var(--primary-light);
    color: var(--primary-color) !important;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    border: 1px solid rgba(2, 132, 199, 0.2);
}

.nav-btn:hover {
    background-color: var(--primary-color);
    color: #ffffff !important;
}

/* Butang Suis Light/Dark Mode */
.theme-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-btn:hover {
    background-color: var(--primary-light);
    transform: scale(1.1);
}

.nav-toggle { display: none; }

/* --- 🚀 3. HERO SECTION --- */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(2, 132, 199, 0.06), transparent 50%);
    padding: 4rem 0;
}

.hero-content {
    width: 90%;
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
}

.badge {
    background-color: var(--primary-badge);
    color: var(--primary-color);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(2, 132, 199, 0.15);
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--text-title);
    font-weight: 800;
    line-height: 1.1;
}

.hero h2 {
    font-size: 2.2rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero .bio-short {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn.primary { background-color: var(--primary-color); color: #fff; }
.btn.primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); }
.btn.secondary { border: 1px solid var(--border-color); color: var(--text-muted); background: var(--bg-card); }
.btn.secondary:hover { background-color: var(--bg-primary); transform: translateY(-2px); }

/* --- 👤 4. ABOUT SECTION & NEW TIMELINE --- */
.about-section { background-color: var(--bg-card); border-top: 1px solid var(--border-about); border-bottom: 1px solid var(--border-about); }
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 4rem;
    align-items: center;
}

.about-img-container {
    position: relative;
    max-width: 340px;
    justify-self: center;
}

.about-img {
    width: 100%;
    border-radius: 16px;
    z-index: 2;
    position: relative;
    box-shadow: 0 15px 30px var(--shadow-sm);
    object-fit: cover;
    aspect-ratio: 4/5;
}

.img-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-color);
    top: 15px;
    left: 15px;
    border-radius: 16px;
    z-index: 1;
}

.about-text h3::after {
    content: ''; display: block; width: 50px; height: 4px; background: var(--primary-color); margin-top: 8px; border-radius: 2px;
}

.about-text p { color: var(--text-muted); margin: 1.5rem 0; font-size: 1.05rem; text-align: justify; }

.edu-timeline { margin-top: 2rem; border-left: 2px solid var(--border-color); padding-left: 1.5rem; }
.edu-item { position: relative; margin-bottom: 2rem; }

.edu-item::before {
    content: ''; position: absolute; width: 12px; height: 12px; background: var(--primary-color); border-radius: 50%; left: -22px; top: 6px;
    border: 2px solid var(--bg-card); box-shadow: 0 0 0 2px var(--primary-color);
}

.edu-year { font-size: 0.85rem; color: var(--primary-color); font-weight: 700; display: block; margin-bottom: 0.2rem; }
.edu-item h4 { color: var(--text-title); font-size: 1.15rem; font-weight: 700; }
.edu-item h5 { color: var(--text-muted); font-weight: 600; font-size: 1rem; }
.edu-details { color: var(--text-sub); font-size: 0.95rem; margin-top: 0.2rem !important; }

.muet-highlight h4 { color: var(--text-title); }
.highlight-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color) !important;
    font-weight: 700;
    padding: 0.1rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(2, 132, 199, 0.15);
}

/* --- 💼 5. EXPERIENCE SECTION --- */
.experience-section { background-color: var(--bg-primary); }
.exp-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 6px -1px var(--shadow-sm);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-about);
    padding-bottom: 1.2rem;
    margin-bottom: 1.5rem;
}

.exp-header h4 { font-size: 1.3rem; color: var(--text-title); font-weight: 700; }
.exp-header h5 { color: var(--primary-color); font-weight: 600; }
.exp-date { color: var(--text-sub); font-size: 0.9rem; font-weight: 500; }
.exp-bullets { list-style-position: inside; color: var(--text-muted); }
.exp-bullets li { margin-bottom: 0.8rem; font-size: 1rem; }

/* --- 🛠️ 6. PROJECTS SECTION & TWIN BUTTONS --- */
.projects-section { background-color: var(--bg-card); }
.section-desc { color: var(--text-sub); margin-top: 0.5rem; margin-bottom: 3rem; font-size: 1.05rem; }
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-project-card);
    padding: 2.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover { transform: translateY(-5px); border-color: var(--primary-color); box-shadow: 0 12px 20px var(--shadow-hover); }
.tag {
    position: absolute; top: 1.5rem; right: 1.5rem; background: var(--primary-light); color: var(--primary-color); font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.75rem; border-radius: 50px;
}

.project-card h4 { font-size: 1.4rem; color: var(--text-title); margin-top: 1rem; font-weight: 700; }
.project-subtitle { color: var(--primary-color); font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; }
.project-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }

.tech-tags { margin-bottom: 0.5rem; }
.tech-tags span {
    background: var(--bg-card); color: var(--text-muted); padding: 0.2rem 0.6rem; font-size: 0.8rem; border-radius: 6px; margin-right: 0.4rem; display: inline-block; margin-bottom: 0.4rem; font-weight: 600; border: 1px solid var(--border-color);
}

/* Struktur Butang Kembar Rapat Sebelah-menyebelah */
.project-links-group {
    display: flex;
    gap: 0.8rem;
    width: 100%;
    margin-top: 1rem;
}

.project-git-link, .project-demo-link {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.65rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-git-link i { font-size: 1.1rem; color: var(--text-title); }
.project-git-link:hover {
    color: var(--text-title);
    border-color: var(--text-title);
    background: rgba(0, 0, 0, 0.02);
    transform: translateY(-1px);
}

.project-demo-link { 
    background-color: var(--primary-light); 
    color: var(--primary-color); 
    border-color: rgba(2, 132, 199, 0.2); 
}
.project-demo-link:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* --- 🖼️ 7. HIGH INTENSITY SLIDER MODAL FOR MULTIPLE IMAGES --- */
.modal-overlay {
    display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; 
    overflow: hidden; background-color: rgba(15, 23, 42, 0.9); backdrop-filter: blur(12px); 
    justify-content: center; align-items: center; flex-direction: column;
}

/* Kontainer Struktur Utama Slide */
.modal-slider-wrapper {
    position: relative;
    width: 85%;
    max-width: 380px; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: popupZoom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
    max-height: 75vh;
}

@keyframes popupZoom { 
    from { transform: scale(0.95); opacity: 0; } 
    to { transform: scale(1); opacity: 1; } 
}

.modal-close { 
    position: absolute; top: 25px; right: 35px; color: #f8fafc; 
    font-size: 38px; font-weight: bold; cursor: pointer; transition: color 0.2s;
}
.modal-close:hover { color: var(--primary-color); }

/* Butang Anak Panah Kiri & Kanan (Slide Nav) */
.slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15); color: #ffffff; border: none;
    width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; z-index: 10; backdrop-filter: blur(4px);
}
.slider-arrow:hover { background: var(--primary-color); color: #ffffff; }
.arrow-left { left: -55px; }
.arrow-right { right: -55px; }

#modalCaption { 
    text-align: center; color: #94a3b8; font-weight: 600; 
    padding-top: 15px; font-size: 0.95rem; letter-spacing: 0.5px;
}

/* --- ⚡ 8. SKILLS SECTION --- */
.skills-section { background-color: var(--bg-primary); }
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg-card); 
    padding: 2rem; 
    border-radius: 12px; 
    border: 1px solid var(--border-color); 
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card:hover {
    transform: translateY(-8px) scale(1.02); 
    border-color: var(--primary-color); 
    box-shadow: 0 20px 25px -5px var(--shadow-sm), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.skill-icon { font-size: 2.2rem; color: var(--primary-color); margin-bottom: 1.2rem; transition: transform 0.3s ease; }
.skill-card:hover .skill-icon { transform: rotate(-5deg) scale(1.1); }
.skill-card h4 { color: var(--text-title); margin-bottom: 0.6rem; font-weight: 700; font-size: 1.2rem; }
.skill-card p { color: var(--text-muted); font-size: 0.95rem; }

/* --- 📞 9. CONTACT SECTION --- */
.contact-section { background-color: var(--bg-card); }
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-box {
    background: var(--bg-primary);
    padding: 2.5rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.contact-box:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-3px);
}

.contact-box i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.contact-box h4 { color: var(--text-title); font-size: 1.2rem; margin-bottom: 0.5rem; font-weight: 700; }
.contact-box p { color: var(--primary-color); font-size: 0.95rem; font-weight: 600; text-decoration: underline; }

/* --- 📝 10. FOOTER --- */
footer {
    background-color: #0f172a; color: #94a3b8; text-align: center; padding: 2.5rem 0; font-size: 0.9rem; font-weight: 500;
    border-top: 1px solid #1e293b;
}

/* --- 📱 11. MOBILE SMART RESPONSIVE CONFIGURATION --- */
@media (max-width: 768px) {
    .section-container { padding: 3.5rem 0; }
    .hero h1 { font-size: 2.4rem; }
    .hero h2 { font-size: 1.6rem; }
    .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .exp-header { flex-direction: column; gap: 0.4rem; }
    
    /* Jadikan butang menegak pada mobile supaya tak sempit */
    .project-links-group { flex-direction: column; gap: 0.5rem; }
    
    /* Selaras susunan panah modal pada skrin mobile */
    .arrow-left { left: 10px; background: rgba(15, 23, 42, 0.6); }
    .arrow-right { right: 10px; background: rgba(15, 23, 42, 0.6); }

    .nav-toggle-label {
        display: block; cursor: pointer; padding: 1rem; position: relative; z-index: 2000;
    }
    .nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
        display: block; background: var(--text-title); height: 2.5px; width: 24px; position: relative; transition: all 0.25s ease;
    }
    .nav-toggle-label span::before { content: ''; top: -7px; left: 0; position: absolute; }
    .nav-toggle-label span::after { content: ''; bottom: -7px; left: 0; position: absolute; }

    nav {
        position: fixed; 
        top: 0; 
        bottom: 0; 
        left: 100%; 
        width: 80%; 
        max-width: 320px;
        background: var(--bg-card); 
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15); 
        padding: 6rem 2.5rem;
        display: flex; 
        flex-direction: column; 
        gap: 2rem; 
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
        z-index: 1500; 
    }
    nav a { margin-left: 0; font-size: 1.15rem; color: var(--text-title); border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
    .nav-btn { text-align: center; border-bottom: none; background-color: var(--primary-color); color: #ffffff !important; }

    .nav-toggle:checked ~ nav { left: calc(100% - 80%); } 
    .nav-toggle:checked ~ nav { left: unset; right: 0; }
    
    .nav-toggle:checked ~ .nav-toggle-label span { background: transparent; }
    .nav-toggle:checked ~ .nav-toggle-label span::before { transform: rotate(45deg); top: 0; background: var(--text-title); }
    .nav-toggle:checked ~ .nav-toggle-label span::after { transform: rotate(-45deg); bottom: 0; background: var(--text-title); }
}