/* ===== CSS VARIABLES ===== */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #1e40af;
    --accent: #60a5fa;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --dark-3: #334155;
    --light: #f8fafc;
    --light-2: #f1f5f9;
    --text: #334155;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --gradient: linear-gradient(135deg, #3b82f6, #1e40af);
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
}

[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary: #3b82f6;
    --accent: #93c5fd;
    --dark: #f8fafc;
    --dark-2: #e2e8f0;
    --dark-3: #cbd5e1;
    --light: #0f172a;
    --light-2: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.4);
    --gradient: linear-gradient(135deg, #60a5fa, #3b82f6);
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
}

/* ===== GLOBAL RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-secondary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== NAVIGATION ===== */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] #navbar {
    background: rgba(30, 41, 59, 0.95);
}

#navbar.scrolled {
    box-shadow: 0 4px 20px var(--shadow);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    text-decoration: none;
}

.logo-dot {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-menu a:hover {
    color: var(--primary);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    background: var(--light-2);
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--primary);
}

.theme-icon {
    font-size: 1.2rem;
    color: var(--text);
    transition: all 0.3s ease;
}

.theme-icon.active {
    color: var(--primary);
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.sphere-1 {
    width: 500px;
    height: 500px;
    background: var(--gradient);
    top: -100px;
    right: -100px;
}

.sphere-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    bottom: -100px;
    left: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
}

.hero-content {
    max-width: 900px;
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

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

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

/* ===== ABOUT SECTION ===== */
#about {
    padding: 6rem 2rem;
    background: var(--bg-primary);
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    /* Change from center to flex-start */
    align-items: flex-start; 
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* This margin accounts for the H2 height + its margin-bottom */
    /* Adjust '5.5rem' if you change your H2 font size later */
    margin-top: 5.5rem; 
    align-self: flex-start;
}

.about-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.about-content p {
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.skill-item {
    background: var(--light-2);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

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

.skill-item i {
    color: var(--primary);
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.skill-item span {
    font-weight: 600;
    color: var(--dark);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: flex-start;
}

.stat-card {
    background: var(--gradient);
    padding: 2rem 2.5rem;
    border-radius: 16px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    min-width: 280px;
    max-width: 320px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ===== PROJECTS SECTION ===== */
#projects {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--dark);
    text-align: center;
    margin-bottom: 1rem;
}

.section-description {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.project-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-lg);
}

.project-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

.project-card p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(30, 64, 175, 0.1));
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ===== PROJECT DETAIL PAGE ===== */
.project-detail {
    padding: 8rem 2rem 4rem;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.detail-container {
    max-width: 900px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary);
}

.project-header {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.project-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.project-actions {
    margin-bottom: 2rem;
}

.project-content {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    line-height: 1.8;
}

.project-content h1,
.project-content h2,
.project-content h3 {
    color: var(--dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.project-content h2 {
    font-size: 1.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.project-content h3 {
    font-size: 1.4rem;
}

.project-content p {
    margin-bottom: 1rem;
    color: var(--text);
}

.project-content ul,
.project-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.project-content code {
    background: var(--light-2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--primary);
}

.project-content pre {
    background: var(--dark-2);
    color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

[data-theme="dark"] .project-content pre {
    background: #0f172a;
}

.project-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.project-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* ===== CONTACT MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-primary);
    margin: 10% auto;
    padding: 3rem;
    border-radius: 20px;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--primary);
}

.modal-content h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 2rem;
    text-align: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--light-2);
    border-radius: 12px;
    transition: all 0.3s;
}

.contact-item:hover {
    background: var(--border);
    transform: translateX(5px);
}

.contact-item i {
    font-size: 2rem;
    color: var(--primary);
    width: 40px;
    text-align: center;
}

.contact-item h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.contact-item a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--primary);
}

/* ===== FOOTER ===== */
footer {
    background: var(--dark-2);
    color: #ffffff; 
    padding: 3rem 2rem;
    text-align: center;
}

[data-theme="dark"] footer {
    background: #0a0f1a;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-email {
    margin: 1rem 0;
    font-size: 1.1rem;
}

.footer-email a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-email a:hover {
    color: var(--accent);
}

.socials {
    margin-top: 1.5rem;
    font-size: 1.5rem;
}

.socials a {
    color: #ffffff;
    margin: 0 0.75rem;
    transition: all 0.3s;
    display: inline-block;
}

.socials a:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .about-stats {
        margin-top: 0;
        align-items: center;
        align-self: center;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 1rem 1.5rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .hero {
        padding: 6rem 1.5rem 3rem;
    }

    #about {
        padding: 4rem 1.5rem;
    }

    #projects {
        padding: 4rem 1.5rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .project-detail {
        padding: 6rem 1.5rem 3rem;
    }

    .project-header,
    .project-content {
        padding: 2rem;
    }

    .modal-content {
        margin: 20% 1rem;
        padding: 2rem;
    }

    .sphere-1,
    .sphere-2 {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }

    .nav-menu {
        font-size: 0.9rem;
        gap: 0.75rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .contact-item {
        padding: 1rem;
    }

    .contact-item i {
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}   