/* --- 1. Reset & Base Styles --- */
/* A small reset ensures consistency across browsers */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Better font stack for a modern, professional look */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.8; /* Improves readability */
    max-width: 780px; /* Limits line length for comfortable reading */
    margin: 0 auto; /* Centers content */
    padding: 2rem 1.5rem;
    background-color: white;
    color: black;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- 2. Typography & Links --- */
h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0.5rem 0 1.5rem 0;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

a {
    color: darkblue;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

a:hover {
    color: goldenrod;
    text-decoration: underline; /* Adds clear affordance */
}

/* --- 3. Dark Mode --- */
body.dark-mode {
    background-color: #0a0a0a; /* Softer than pure black */
    color: #e5e7eb; /* Slightly softer than pure white */
}

body.dark-mode a {
    color: #7ec8e3; /* Softer light blue */
}

body.dark-mode a:hover {
    color: #f0e68c; /* Light goldenrod */
}

/* --- 4. Theme Switch Button --- */
#theme-switch {
    padding: 0.6rem 1.5rem;
    margin: 1.5rem 0 2rem 0;
    cursor: pointer;
    background-color: lightblue;
    border: none;
    border-radius: 30px; /* Pill shape looks more polished */
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#theme-switch:hover {
    background-color: lightgoldenrodyellow;
    transform: scale(1.03); /* Subtle interaction feedback */
}

/* Dark mode override for the button */
body.dark-mode #theme-switch {
    background-color: #1e3a5f;
    color: white;
}

body.dark-mode #theme-switch:hover {
    background-color: #2a4a7f;
}

/* --- 5. Navigation Bar --- */
.navbar {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background-color: white;
    border-bottom: 2px solid darkblue;
    z-index: 1000;
    margin-bottom: 2rem;
    border-radius: 0 0 12px 12px; /* Slight curve at bottom */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark-mode .navbar {
    background-color: #0a0a0a;
    border-bottom-color: #7ec8e3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-brand a {
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    color: darkblue;
}

body.dark-mode .nav-brand a {
    color: #7ec8e3;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    text-decoration: none;
    color: black;
    padding: 0.5rem 0;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative; /* For the underline animation */
}

body.dark-mode .nav-links li a {
    color: #e5e7eb;
}

/* Professional underline animation on hover */
.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: goldenrod;
    transition: width 0.2s ease;
}

body.dark-mode .nav-links li a::after {
    background-color: #f0e68c;
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-links li a:hover {
    color: goldenrod;
}

body.dark-mode .nav-links li a:hover {
    color: #f0e68c;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: darkblue;
    padding: 0.3rem 0.6rem;
}

body.dark-mode .mobile-menu-btn {
    color: #7ec8e3;
}

/* --- 6. Logo & Hero Section --- */
.logo-container {
    text-align: center;
    margin-bottom: 0.5rem;
}

.logo-container img {
    max-width: 140px;
    height: auto;
    display: inline-block;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* --- 7. Internal Links Box (Your "Explore my work" section) --- */
.featured-links {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: rgba(0, 0, 139, 0.04);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(0, 0, 139, 0.08);
}

body.dark-mode .featured-links {
    background-color: rgba(126, 200, 227, 0.06);
    border-color: rgba(126, 200, 227, 0.12);
}

.featured-links p {
    margin-bottom: 0.5rem;
}

.featured-links a {
    margin: 0 0.5rem;
}

/* --- 8. Social Links Footer --- */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    justify-content: center;
}

body.dark-mode .social-links {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    background-color: rgba(0, 0, 139, 0.04);
    transition: background-color 0.2s ease;
}

body.dark-mode .social-links a {
    background-color: rgba(126, 200, 227, 0.06);
}

.social-links a:hover {
    background-color: rgba(0, 0, 139, 0.08);
    text-decoration: none;
}

body.dark-mode .social-links a:hover {
    background-color: rgba(126, 200, 227, 0.12);
}

/* --- 9. Form Styles (Your Contact Page) --- */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .form-container {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input, textarea {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
    color: black;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
}

body.dark-mode input,
body.dark-mode textarea {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border-color: #333;
}

input:focus, textarea:focus {
    outline: none;
    border-color: darkblue;
    box-shadow: 0 0 0 3px rgba(0, 0, 139, 0.1);
}

body.dark-mode input:focus,
body.dark-mode textarea:focus {
    border-color: #7ec8e3;
    box-shadow: 0 0 0 3px rgba(126, 200, 227, 0.1);
}

button[type="submit"] {
    background-color: darkblue;
    color: white;
    padding: 12px 32px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

body.dark-mode button[type="submit"] {
    background-color: #1e3a5f;
    color: white;
}

button[type="submit"]:hover {
    background-color: goldenrod;
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode button[type="submit"]:hover {
    background-color: #f0e68c;
    color: #0a0a0a;
}

/* --- 10. Mobile Responsiveness --- */
@media (max-width: 768px) {
    body {
        font-size: 17px;
        padding: 1rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    /* Mobile Navigation */
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem 0;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: white;
        border-bottom: 2px solid darkblue;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }
    
    body.dark-mode .nav-links {
        background-color: #0a0a0a;
        border-bottom-color: #7ec8e3;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .navbar {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
        border-radius: 0 0 8px 8px;
    }
    
    /* Logo size on mobile */
    .logo-container img {
        max-width: 100px;
    }
    
    /* Form adjustments */
    .form-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    input, textarea {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 14px 16px;
    }
    
    /* Social links wrap better */
    .social-links {
        gap: 0.8rem;
    }
    
    .social-links a {
        padding: 0.3rem 0.8rem;
        font-size: 0.95rem;
    }
}

/* --- 11. Extra Polish: Images & Misc --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* A subtle divider for visual rhythm */
.section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1), transparent);
    margin: 2rem 0;
}

body.dark-mode .section-divider {
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.08), transparent);
}