/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-accent: linear-gradient(135deg, var(--accent), var(--primary));
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
.section-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    text-align: center;
}

.lead {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* ===== LAYOUT COMPONENTS ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 4rem 0;
}

/* ===== HERO SECTION ===== */
.hero-image {
    position: relative;
    height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.parallax {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.15"/><circle cx="20" cy="80" r="0.5" fill="white" opacity="0.15"/><circle cx="80" cy="20" r="0.5" fill="white" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

.hero-text {
    text-align: center;
    z-index: 2;
    color: white;
    max-width: 800px;
    padding: 0 2rem;
}

.hero-text h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out;
}

.hero-text p {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== BUTTONS ===== */
.button, .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.button:hover, .cta-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.submit-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== NAVIGATION ===== */
#navbar {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(74, 74, 74, 0.492);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.75rem 1.5rem;
    color: rgb(255, 255, 255);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
} 

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}


/* ===== ABOUT SECTION ===== */
.about-section {
    background: var(--bg-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 3rem;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.highlight {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.highlight h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.highlight p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

/* ===== SKILLS SECTION ===== */
.skills-section {
    background: var(--bg-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-category {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== PROJECTS SECTION ===== */
.projects-section {
    background: var(--bg-primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.project-card {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.project-image {
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 0.8rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--primary-dark);
}

.projects-nav {
    text-align: center;
    margin-top: 2rem;
}

/* ===== TERMINAL SECTION ===== */
.terminal-section {
    background: #000;
    padding: 4rem 2rem;
}

.terminal-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

.terminal-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.terminal-subtitle {
    color: #9ca3af;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.iterm-window {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #1d1f21;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: 1px solid #2d2d2d;
}

.iterm-titlebar {
    background: linear-gradient(180deg, #3c3c3c 0%, #2d2d2d 100%);
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid #1a1a1a;
    position: relative;
}

.traffic-lights {
    display: flex;
    gap: 8px;
}

.traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.traffic-light.close { background: linear-gradient(135deg, #ff6b63 0%, #ff5245 100%); }
.traffic-light.minimize { background: linear-gradient(135deg, #ffc541 0%, #ffb02e 100%); }
.traffic-light.maximize { background: linear-gradient(135deg, #32d74b 0%, #28ca42 100%); }
.traffic-light:hover { opacity: 0.8; transform: scale(1.1); }

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #c5c5c5;
    font-size: 13px;
    font-weight: 500;
}

.iterm-body {
    background: #1d1f21;
    padding: 20px;
    min-height: 400px;
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #c5c8c6;
    overflow-y: auto;
    max-height: 500px;
}

.terminal-line { display: flex; margin-bottom: 4px; }
.prompt { color: #81a2be; user-select: none; }
.command { color: #c5c8c6; margin-left: 8px; }
.output { color: #c5c8c6; white-space: pre-wrap; margin: 4px 0; }
.error { color: #cc6666; }
.success { color: #b5bd68; }
.warning { color: #f0c674; }
.info { color: #8abeb7; }
.current-line { display: flex; align-items: center; }

.cursor {
    width: 8px;
    height: 16px;
    background: #c5c8c6;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.input-area {
    background: transparent;
    border: none;
    outline: none;
    color: #c5c8c6;
    font-family: inherit;
    font-size: inherit;
    margin-left: 8px;
    flex: 1;
}

.ascii-art { 
    color: #81a2be; 
    font-size: 11px; 
    line-height: 1.2; 
    white-space: pre; 
    font-family: inherit; 
    margin: 8px 0;
}

/* ===== CONTACT SECTION ===== */
.form-section {
    background: var(--bg-secondary);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info {
    padding: 2rem 0;
}

.contact-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.contact-method svg {
    color: var(--primary);
}

.form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form input, .form select, .form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.form input:focus, .form select:focus, .form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

/* ===== ANIMATIONS ===== */
.loading {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-text h1 { font-size: 3rem; }
    .hero-text p { font-size: 1.2rem; }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    #navbar {
        position: static;
        transform: none;
        margin: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form { padding: 1.5rem; }
    .iterm-window { margin: 0 1rem; }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 3rem 0;
    }
}

/* ===== THEME SWITCH STYLES ===== */
/* Add these styles to your style.css file */

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-left: auto;
    align-self: center;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "☀️";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.4s ease;
}

/* Moon emoji on the right in light mode */
.slider:after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: all 0.4s ease;
}

/* When checked (dark mode) */
input:checked + .slider {
    background: var(--gradient-primary);
}

/* The circle and emoji (always visible, emoji centered) */
.slider:before {
    position: absolute;
    content: "☀️";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s, content 0s;
    z-index: 1;
}

/* Move the circle and switch emoji when checked */
input:checked + .slider:before {
    transform: translateX(30px);
    background: #00bcd4;
    content: "🌙";
}

/* Remove the extra emoji spans from your HTML and CSS */
.slider .emoji-sun,
.slider .emoji-moon {
    display: none;
}

/* Move the circle when checked */
input:checked + .slider:before {
    transform: translateX(30px);
    background: var(--bg-dark);
}

/* Fade sun out, moon in */
input:checked + .slider .emoji-sun {
    opacity: 0;
}
input:checked + .slider .emoji-moon {
    opacity: 1;
}

@keyframes emoji-fade {
    0% {
        opacity: 1;
    }
    40% {
        opacity: 0;
    }
    60% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}


/* Remove the .slider:after moon emoji and related transitions */
.slider:after,
input:checked + .slider:after {
    content: "";
    opacity: 0;
    transition: none;
}

/* ===== THEME VARIABLES ===== */
/* Add these CSS variables to your existing :root or create a new :root block */

:root {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #6366f1;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.1);
    --navbar-bg: rgba(255, 255, 255, 0.1);
}

/* Dark theme colors */
body.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --accent-color: #00bcd4;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.05);
    --navbar-bg: rgba(0, 0, 0, 0.3);
}

/* ===== THEME TRANSITIONS ===== */
/* Apply these to your existing elements or add them */

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

#navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.nav-link {
    background: #6365f154 !important;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.section-title {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.hero-text h1 {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.hero-text p {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* Terminal section theme support */
.terminal-section {
    background-color: var(--bg-dark);
    transition: background-color 0.3s ease;
}

.iterm-window {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.iterm-titlebar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* Form section theme support */
.form-section {
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.form-group label {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Card elements */
.about-highlights .highlight,
.skill-category,
.projects-grid .project-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* Ensure hero-text paragraph stays the same olor as in dark mode */
.hero-text p {
    color: #d1d5db !important;
    transition: none !important;
}

.typewriter-cursor {
    display: inline-block;
    font-weight: bold;
    font-size: 1.1em;
    margin-left: 2px;
}