/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Color Palette - Modern Dark Theme */
    --bg-color: #0f172a;       /* Deep dark blue/slate */
    --card-bg: #1e293b;        /* Slightly lighter for cards */
    --text-primary: #f8fafc;   /* Almost white */
    --text-secondary: #94a3b8; /* Muted gray */
    --accent: #38bdf8;         /* Bright Cyan */
    --accent-glow: rgba(56, 189, 248, 0.3);
    
    /* Spacing & Transition */
    --nav-height: 80px;
    --transition: all 0.3s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* =========================================
   2. GLASSMORPHISM NAVBAR
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: var(--nav-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    
    /* The Glass Effect */
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

/* Underline animation on hover */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* =========================================
   3. HERO SECTION (Compact / No Void)
   ========================================= */
.hero {
    /* Reduced height to bring About section closer */
    min-height: 50vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 20px 0; /* No bottom padding */
    position: relative;
    overflow: hidden; 
}

/* Background Glow Effect */
.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

/* Gradient Text for Name */
.hero h1 span {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

/* =========================================
   4. ABOUT SECTION
   ========================================= */
.about {
    /* Pulled up closer to hero */
    padding: 2rem 10% 4rem; 
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.about h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.about p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Skill Tags */
.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center; /* Center the tags */
    margin-top: 2rem;
}

.skills span {
    background-color: var(--card-bg);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: default;
    transition: var(--transition);
}

.skills span:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 20px -5px var(--accent-glow);
    background-color: rgba(56, 189, 248, 0.1);
}

/* =========================================
   5. 3D FLIP CARDS (Fun Facts)
   ========================================= */
.facts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    perspective: 1000px;
}

.flip-card {
    background-color: transparent;
    height: 180px; /* Card Height */
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.flip-card-front {
    background-color: var(--card-bg);
    color: var(--accent);
}

.flip-card-front h3 {
    /* UPDATED: Smaller Font */
    font-size: 1.25rem;
    font-weight: 600;
}

.flip-card-back {
    background: linear-gradient(135deg, var(--card-bg), #1e293b);
    color: var(--text-primary);
    transform: rotateY(180deg);
    border: 1px solid var(--accent);
}

.flip-card-back p {
    /* UPDATED: Smaller Font */
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 0;
}

/* =========================================
   6. PROJECTS PAGE STYLES
   ========================================= */
.page-header {
    text-align: center;
    padding: 6rem 20px 3rem;
    animation: fadeInUp 0.6s ease-out forwards;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 10%;
    max-width: 1200px;
    margin: 0 auto 4rem;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5);
}

.project-card h3 {
    /* UPDATED: Smaller Heading */
    font-size: 1.25rem; 
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-card p {
    /* UPDATED: Smaller Body Text */
    font-size: 0.9rem; 
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(56, 189, 248, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* =========================================
   7. FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4rem;
}

/* =========================================
   8. ANIMATIONS & RESPONSIVE
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1.5rem;
    }
    .nav-links {
        display: none; /* Add JS later for hamburger menu */
    }
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* =========================================
   9. FORMS & INPUTS (For Subject Selection)
   ========================================= */
.form-container {
    max-width: 800px;
    margin: 0 auto 4rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: #0f172a;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Result Box */
#result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--accent);
    border-radius: 8px;
    display: none; /* Hidden by default */
}

.error-msg {
    color: #ef4444; /* Red for errors */
    font-size: 0.85rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    display: none;
}