/* CSS Variables - Dark Mode (Default) */
:root {
    --primary-color: #6366f1; /* Purple */
    --secondary-color: #4c1d95; /* Dark Purple */
    --accent-color: #8b5cf6; /* Light Purple */
    --dark-blue: #1e3a8a; /* Dark Blue */
    --darker-blue: #1e293b; /* Darker Blue */
    --black: #000000;
    --dark-bg: #0a0a0f;
    --white: #ffffff;
    --light-gray: #e5e7eb;
    --dark-gray: #374151;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --bg-overlay: rgba(10, 10, 15, 0.5);
    --card-bg: rgba(30, 41, 59, 0.5);
    --nav-bg: rgba(10, 10, 15, 0.8);
}

/* CSS Variables - Light Mode */
[data-theme="light"] {
    --primary-color: #6366f1; /* Purple */
    --secondary-color: #4c1d95; /* Dark Purple */
    --accent-color: #8b5cf6; /* Light Purple */
    --dark-blue: #1e3a8a; /* Dark Blue */
    --darker-blue: #1e293b; /* Darker Blue */
    --black: #000000;
    --dark-bg: #f8f9fa;
    --white: #ffffff;
    --light-gray: #e5e7eb;
    --dark-gray: #374151;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --bg-overlay: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.8);
    --nav-bg: rgba(255, 255, 255, 0.9);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    background-color: var(--dark-bg);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light mode font styles */
[data-theme="light"] body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
}

[data-theme="light"] h1, 
[data-theme="light"] h2, 
[data-theme="light"] h3 {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

[data-theme="light"] .hero-title .name {
    font-weight: 700;
    letter-spacing: -0.03em;
}

[data-theme="light"] .section-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(-45deg, #0a0a0f, #1e293b, #1e3a8a, #4c1d95, #6366f1, #8b5cf6, #a78bfa);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    opacity: 0.95;
    transition: opacity 0.3s ease;
}

/* Light mode animated background - lighter colors */
[data-theme="light"] .animated-bg {
    background: linear-gradient(-45deg, #e0e7ff, #c7d2fe, #a5b4fc, #818cf8, #6366f1, #8b5cf6, #a78bfa);
    opacity: 0.6;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.25) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.25) 0%, transparent 60%),
        radial-gradient(circle at 40% 20%, rgba(30, 58, 138, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(167, 139, 250, 0.2) 0%, transparent 55%),
        radial-gradient(circle at 90% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 45%);
    animation: pulse 4s ease-in-out infinite;
}

.animated-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(99, 102, 241, 0.08) 2px, rgba(99, 102, 241, 0.08) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139, 92, 246, 0.08) 2px, rgba(139, 92, 246, 0.08) 4px);
    animation: gridMove 12s linear infinite;
    opacity: 0.6;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    33% {
        opacity: 0.85;
        transform: scale(1.05);
    }
    66% {
        opacity: 0.9;
        transform: scale(0.95);
    }
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(80px, 80px) rotate(180deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

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

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

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

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

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

[data-theme="light"] .theme-toggle {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(99, 102, 241, 0.25);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 3px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 20px 80px;
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    contain: layout style paint;
    margin-bottom: 2rem;
}

.greeting {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInUp 1s ease 0.2s forwards;
}

.name {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color), var(--white));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: fadeInUp 1s ease 0.4s forwards;
}

.title {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    opacity: 0;
    animation: fadeInUp 1s ease 0.8s forwards;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1s ease 1s forwards;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease 1.2s forwards;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.social-link svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.social-link:hover svg {
    transform: scale(1.2);
}

.btn {
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
    cursor: pointer;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

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

.btn-secondary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 15px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        top: 8px;
    }
    100% {
        opacity: 0;
        top: 20px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Styles */
section {
    padding: 100px 0;
    position: relative;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* About Section */
.about {
    background: var(--bg-overlay);
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
}

.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.about-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 20px;
    border: 4px solid var(--primary-color);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4),
                inset 0 0 0 2px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
    display: block;
    object-fit: contain;
    background: transparent;
}

.about-image img:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.6),
                inset 0 0 0 2px var(--accent-color);
    border-color: var(--accent-color);
}

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

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
}

.stat-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.stat-item p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Projects Section */
.projects {
    background: var(--bg-overlay);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--dark-blue), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-placeholder {
    font-size: 4rem;
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-tags span {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.project-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.project-link {
    display: inline-block;
    margin-top: 0;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.project-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    transform: translateX(5px);
}

/* Contact Section */
.contact {
    background: var(--bg-overlay);
}

.contact-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-overlay);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
}

.btn-submit {
    width: 100%;
    margin-top: 1rem;
}

.form-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    display: none;
}

.form-message.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #4ade80;
    display: block;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    display: block;
}

/* Footer */
.footer {
    background: var(--nav-bg);
    padding: 2rem 0;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    text-align: center;
}

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

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

.footer-social-links .social-link {
    width: 45px;
    height: 45px;
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid rgba(99, 102, 241, 0.3);
}

.footer-social-links .social-link:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-3px) scale(1.1);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--nav-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        border-top: 1px solid rgba(99, 102, 241, 0.2);
        backdrop-filter: blur(10px);
    }

    .theme-toggle {
        margin-left: 0.5rem;
        width: 40px;
        height: 40px;
    }

    .nav-menu.active {
        left: 0;
    }

    .name {
        font-size: 2.5rem;
    }

    .title {
        font-size: 1.3rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

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

    .contact-form {
        padding: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .social-links {
        gap: 1rem;
    }

    .social-link {
        width: 45px;
        height: 45px;
    }

    .footer-social-links {
        gap: 1rem;
    }

    .footer-social-links .social-link {
        width: 40px;
        height: 40px;
    }
}

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

    .section-title {
        font-size: 1.8rem;
    }

    .about-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        order: -1;
    }

    .about-image img {
        max-width: 300px;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }
}

/* Typing Animation Styles */
.typing-cursor {
    display: inline-block;
    margin-left: 2px;
    color: var(--primary-color);
    font-weight: 300;
    animation: blink 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    vertical-align: baseline;
    will-change: opacity;
    backface-visibility: hidden;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Ensure smooth typing animation - allow wrapping for hero description */
.hero-title .name {
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    will-change: contents;
    backface-visibility: hidden;
    perspective: 1000px;
}

.hero-title .title {
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    will-change: contents;
    backface-visibility: hidden;
    perspective: 1000px;
}

.hero-description {
    overflow: hidden;
    min-height: 1.5em;
    will-change: contents;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* For section titles that wrap, allow wrapping after typing completes */
.section-title,
.page-title {
    white-space: nowrap;
    overflow: hidden;
    will-change: contents;
    backface-visibility: hidden;
    perspective: 1000px;
}

