/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Palette - Light Mode */
    --primary-hue: 250;
    --primary-sat: 100%;
    --primary-lum: 60%;

    /* Bootstrap Override */
    --bs-secondary-color: var(--text-muted);

    --primary-color: hsl(var(--primary-hue), var(--primary-sat), var(--primary-lum));
    --secondary-color: #00ceffa4;
    --accent-color: #ff2d55;

    --bg-base: #f8f9fc;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-surface-2: rgba(255, 255, 255, 0.9);

    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;

    --border-light: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-text: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --gradient-glow: radial-gradient(circle at top left, rgba(99, 102, 241, 0.15), transparent 40%);

    /* Dimensions */
    --nav-height: 48px;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;

    /* Animation */
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-base: #0f172a;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --bg-surface-2: rgba(30, 41, 59, 0.9);

    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #64748b;

    --border-light: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --primary-color: #818cf8;
    --gradient-primary: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    --gradient-text: linear-gradient(135deg, #a5b4fc 0%, #e879f9 100%);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 25%);
    background-attachment: fixed;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

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

.lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 400;
    max-width: 65ch;
}

/* Utility Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-md);
}

.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    /* Pill shape */
    font-weight: 600;
    transition: all 0.3s var(--ease-smooth);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

/* Navigation */
.navbar {
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.1);
    /* Super transparent initially */
    backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    transition: all 0.4s ease;
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar.scrolled {
    background: var(--bg-surface-2);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    height: 48px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s var(--ease-smooth);
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0 !important;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s var(--ease-elastic);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    padding-top: var(--nav-height);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    background: var(--bg-surface);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.hero .lead {
    margin: 1.5rem auto 2.5rem;
    font-size: 1.35rem;
}

/* Code Rain Background */
.code-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
}

.code-column {
    position: absolute;
    top: -50px;
    color: var(--primary-color);
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    text-align: center;
    animation: rain linear infinite;
}

@keyframes rain {
    to {
        transform: translateY(110vh);
    }
}

/* Skills Section */
.skills {
    padding: 5rem 0;
    position: relative;
}

.skill-item {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
    transition: transform 0.3s var(--ease-elastic);
}

.skill-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.skill-info h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress-value, 0%);
    background: var(--gradient-primary);
    border-radius: 100px;
    transition: width 1.5s var(--ease-smooth);
}

/* Projects Section */
.projects {
    padding: 6rem 0;
}

.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.4s var(--ease-smooth);
    height: 100%;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.project-content {
    padding: 2rem;
}

.project-meta {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
}

.project-content h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-tech-list li {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.project-tech-list li::before {
    content: '→';
    color: var(--primary-color);
    font-weight: bold;
}

/* Experience & Education */
.timeline-wrapper {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 3rem;
    border-left: 2px solid var(--border-light);
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--bg-base);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.timeline-wrapper:hover::before {
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.timeline-yr {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Contact Section */
.contact {
    padding: 6rem 0;
    position: relative;
}

.contact-form {
    background: var(--bg-surface);
    padding: 3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.form-control {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 1.25rem;
    border: 1px solid var(--border-light);
    transition: all 0.3s var(--ease-elastic);
    text-decoration: none;
}

.social-link:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-5px) rotate(10deg);
}

/* Footer & Extras */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    padding: 1rem 0;
    text-align: center;
}

.theme-toggle {
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.theme-toggle:hover {
    background: var(--gradient-primary);
    color: white;
    transform: rotate(15deg);
}

.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 2000;
}

.cursor-glow {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: multiply;
}

[data-theme="dark"] .cursor-glow {
    mix-blend-mode: screen;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-content {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .timeline-wrapper {
        padding-left: 1.5rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-name {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s infinite ease-in-out;
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

/* Dark Mode Form Controls */
[data-theme='dark'] .form-control {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main);
    border-color: var(--glass-border);
}

[data-theme='dark'] .form-control:focus {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-main);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

[data-theme='dark'] .form-control::placeholder {
    color: var(--text-muted);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Override Bootstrap's text-muted to support dark mode */
.text-muted {
    color: var(--text-muted) !important;
}
/* ==========================================
   Mobile Responsiveness & Media Queries
   ========================================== */

@media (max-width: 768px) {
    /* Section Spacing */
    .about,
    .skills,
    .projects,
    .contact {
        padding: 4rem 0; /* Reduced from 6rem */
    }

    /* Hero Section */
    .hero {
        text-align: center;
        padding-top: calc(var(--nav-height) + 2rem);
    }
    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }
    .hero p.lead {
        margin: 0 auto 2rem;
    }
    .hero .d-flex {
        justify-content: center;
    }

    /* Typography */
    h2 {
        font-size: clamp(1.75rem, 6vw, 2rem);
    }

    h3 {
        font-size: clamp(1.25rem, 5vw, 1.5rem);
    }

    /* Timeline & Experience */
    .timeline-wrapper {
        padding-left: 1.5rem;
        margin-bottom: 2rem;
    }
    .timeline-wrapper::before {
        width: 12px;
        height: 12px;
        left: -7px;
    }

    /* Mobile Navbar Dropdown */
    .navbar-collapse {
        background: var(--bg-surface-2);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-top: 1rem;
        border: 1px solid var(--border-light);
        box-shadow: var(--glass-shadow);
        text-align: center;
    }
    
    .nav-link {
        margin: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    /* Tighter Section Spacing */
    .about,
    .skills,
    .projects,
    .contact {
        padding: 3rem 0;
    }

    /* Typography */
    .hero h1 {
        font-size: clamp(1.75rem, 8vw, 2rem);
    }
    h2 {
        font-size: clamp(1.5rem, 6vw, 1.75rem);
    }
    h3 {
        font-size: clamp(1.15rem, 5vw, 1.25rem);
    }

    /* Components */
    .project-content {
        padding: 1.25rem;
    }
    .timeline-wrapper {
        padding-left: 1rem;
    }
    .timeline-wrapper::before {
        left: -6px;
        width: 10px;
        height: 10px;
    }
}
