/* --- Global Variables (Light Mode Default) --- */
:root {
    --primary: #2563eb;        /* Royal Blue */
    --primary-dark: #1e40af;
    --secondary: #0f172a;      /* Dark Slate */
    --text-main: #334155;      /* Dark Grey */
    --text-light: #64748b;     /* Light Grey */
    --bg-body: #f1f5f9;        /* Off-White BG */
    --bg-card: #ffffff;        /* White Card */
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* --- Dark Mode Variables (Activated via JS) --- */
[data-theme="dark"] {
    --primary: #60a5fa;        /* Lighter Blue */
    --primary-dark: #3b82f6;
    --secondary: #f8fafc;      /* White Text */
    --text-main: #cbd5e1;      /* Light Grey Text */
    --text-light: #94a3b8;     /* Muted Text */
    --bg-body: #0f172a;        /* Deep Blue/Black BG */
    --bg-card: #1e293b;        /* Dark Slate Card */
    --white: #1e293b;          /* Remap 'white' class to dark */
    --glass-bg: rgba(15, 23, 42, 0.9); /* Dark Glass */
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
}

html {
    scroll-behavior: smooth;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth Theme Switch */
}

/* --- Typography Utilities --- */
h1, h2, h3 { color: var(--secondary); font-weight: 700; }
a { text-decoration: none; color: inherit; transition: 0.3s; }

.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Header with Glassmorphism --- */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px); /* The "Glass" Effect */
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo { font-size: 1.5rem; letter-spacing: -0.5px; }
.highlight { color: var(--primary); }

.nav-links { display: flex; gap: 30px; list-style: none; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

/* Theme Switch Icon */
.theme-switch {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: transform 0.2s;
}
.theme-switch:hover { transform: rotate(15deg); color: var(--primary); }

/* --- Hero Section --- */
.hero {
    padding: 100px 0;
    text-align: center;
    /* Subtle radial gradient for depth */
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.1) 0%, transparent 40%);
}

.badge-pill {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

.hero h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 20px; }
.hero .description { font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto 30px; }

/* Typewriter Cursor */
.typewriter {
    color: var(--primary);
    font-weight: 700;
    border-right: 2px solid var(--primary);
    padding-right: 5px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0% { border-color: transparent }
    50% { border-color: var(--primary) }
    100% { border-color: transparent }
}

/* Tech Icons */
.tech-stack-icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 40px;
}
.tech-stack-icons i { transition: transform 0.3s ease, color 0.3s ease; }
.tech-stack-icons i:hover { transform: translateY(-5px); color: var(--primary); }

/* Buttons */
.btn {
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn { 
    background: var(--gradient); 
    color: #ffffff; 
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3); 
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4); }

.secondary-btn { 
    background: var(--bg-card); 
    color: var(--secondary); 
    border: 1px solid var(--text-light); 
}
.secondary-btn:hover { border-color: var(--primary); color: var(--primary); }

/* --- Projects Section --- */
.projects-section { padding: 80px 0; }
.section-title { text-align: center; font-size: 2.2rem; margin-bottom: 50px; }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.05);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.project-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: var(--gradient);
    transform: scaleX(0); transform-origin: left; transition: 0.3s;
}
.project-card:hover::before { transform: scaleX(1); }

.card-icon { font-size: 2rem; color: var(--primary); margin-bottom: 15px; }
.tech-tags { font-size: 0.85rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; margin-bottom: 15px; letter-spacing: 0.5px; }
.project-card h3 { margin-bottom: 10px; font-size: 1.4rem; }
.project-card p { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; margin-bottom: 20px; }
.link-text { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* --- CONTACT PAGE STYLES --- */
.contact-wrapper {
    display: flex;
    align-items: center; 
    justify-content: space-between;
    gap: 50px;
    padding: 60px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-info { flex: 1; }
.contact-info h2 { font-size: 2.5rem; margin-bottom: 20px; line-height: 1.2; }
.contact-info p { color: var(--text-light); margin-bottom: 40px; font-size: 1.1rem; }

.info-item { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 30px; }
.icon-box {
    width: 50px; height: 50px;
    background: rgba(37, 99, 235, 0.1); color: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

.info-item h4 { font-size: 1.1rem; margin-bottom: 5px; color: var(--secondary); }
.social-row { display: flex; gap: 15px; margin-top: 20px; }
.social-row a {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--text-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--secondary);
    font-size: 1.1rem;
}
.social-row a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.contact-form-card {
    flex: 1;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.05);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; color: var(--text-main); }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-body); /* Input matches BG */
    border: 1px solid var(--text-light);
    color: var(--text-main);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: 0.3s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.full-width { width: 100%; justify-content: center; }

/* --- Footer --- */
footer { 
    text-align: center; 
    padding: 30px 0; 
    margin-top: auto; 
    color: var(--text-light); 
    font-size: 0.9rem; 
    border-top: 1px solid rgba(0,0,0,0.1);
    background: var(--bg-body);
}
.social-links { margin-top: 10px; font-size: 1.2rem; }
.social-links a { color: var(--text-light); margin: 0 10px; }
.social-links a:hover { color: var(--primary); }

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

/* --- ABOUT PAGE STYLES --- */
.about-hero { text-align: center; margin-bottom: 60px; }
.about-hero h2 { font-size: 2.8rem; margin-bottom: 20px; }

/* Stats Grid */
.stats-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 30px 0;
}

.stat-item h3 { font-size: 2rem; color: var(--primary); margin-bottom: 5px; }
.stat-item p { color: var(--text-light); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }

/* Services Cards */
.section-subtitle { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.service-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: 0.3s;
    border: 1px solid transparent;
}
.service-card:hover { transform: translateY(-5px); border-color: var(--primary); }

.icon-circle {
    width: 60px; height: 60px;
    background: rgba(37, 99, 235, 0.1); color: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; font-size: 1.5rem;
}
.service-card h4 { margin-bottom: 15px; font-size: 1.2rem; }

/* Timeline */
.timeline-wrapper { display: flex; gap: 40px; }

.timeline-box {
    flex: 1;
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.timeline-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 25px; padding-bottom: 15px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}
.timeline-header i { color: var(--primary); font-size: 1.2rem; }
.timeline-header span { font-size: 1.2rem; font-weight: 700; color: var(--secondary); }

.t-item {
    margin-bottom: 25px; position: relative;
    padding-left: 20px; border-left: 2px solid var(--text-light);
}
.t-item::before {
    content: ''; position: absolute; left: -6px; top: 5px;
    width: 10px; height: 10px;
    background: var(--primary); border-radius: 50%;
}
.t-item h4 { font-size: 1rem; margin-bottom: 5px; color: var(--secondary); }
.t-date { font-size: 0.8rem; color: var(--primary); font-weight: 600; display: block; margin-bottom: 8px; }

/* --- PROJECTS PAGE STYLES --- */
.projects-hero { text-align: center; margin-bottom: 50px; padding: 20px 0; }
.projects-hero h2 { font-size: 2.5rem; margin-bottom: 15px; }

.full-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.feature-list { list-style: none; margin: 20px 0; text-align: left; }
.feature-list li {
    margin-bottom: 10px; color: var(--text-main); font-size: 0.95rem;
    display: flex; align-items: center; gap: 10px;
}
.feature-list li i { color: var(--primary); }

/* --- RESPONSIVE / MOBILE MENU --- */
.container { max-width: 1150px; margin: 0 auto; padding: 0 20px; }

@media (min-width: 769px) {
    .burger { display: none; }
    .large-card {
        grid-column: span 2;
        display: flex; flex-direction: column; justify-content: center;
        text-align: left; padding: 40px;
    }
    .large-card .card-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
    .large-card .card-icon { margin-bottom: 0; font-size: 2.5rem; }
    .large-card h3 { font-size: 1.8rem; margin-bottom: 0; }
    .tech-stack-row { display: flex; gap: 10px; margin-bottom: 20px; }
    .large-card p { font-size: 1.05rem; max-width: 800px; }
}

@media (max-width: 768px) {
    html, body { overflow-x: hidden; position: relative; }
    .header-flex { height: auto; padding: 15px 0; }
    .hero h1 { font-size: 2.5rem; }
    .contact-wrapper { flex-direction: column; padding: 40px 20px; }
    .stats-grid { flex-direction: column; gap: 20px; }
    .timeline-wrapper { flex-direction: column; }
    
    .nav-links {
        position: fixed;
        right: 0px; top: 70px;
        height: calc(100vh - 70px);
        background-color: var(--bg-card); /* Matches dark mode card bg */
        display: flex; flex-direction: column;
        align-items: center; justify-content: flex-start;
        padding-top: 40px;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 998;
    }
    .nav-links li { margin: 25px 0; opacity: 0; }
    .nav-active { transform: translateX(0%); }
    .burger { display: block; cursor: pointer; z-index: 1001; }
    .burger div {
        width: 25px; height: 3px;
        background-color: var(--secondary);
        margin: 5px; transition: all 0.3s ease;
    }
    .toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
    .toggle .line2 { opacity: 0; }
    .toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); }
}

@keyframes navLinkFade {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0px); }
}