/* CSS Variables for Light/Dark Mode */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --accent: #dc2626;
    --accent-hover: #b91c1c;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --gradient-start: #dc2626;
    --gradient-end: #f97316;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #ef4444;
    --accent-hover: #f87171;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --card-bg: #1e293b;
    --gradient-start: #ef4444;
    --gradient-end: #fb923c;
}

/* Detect system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --accent: #ef4444;
        --accent-hover: #f87171;
        --border: #334155;
        --shadow: rgba(0, 0, 0, 0.3);
        --card-bg: #1e293b;
        --gradient-start: #ef4444;
        --gradient-end: #fb923c;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header */
header {
    position: sticky;
    top: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] header {
    background-color: rgba(15, 23, 42, 0.9);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.logo-emoji {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.logo-emoji:nth-child(1) {
    animation-delay: 0s;
}

.logo-emoji:nth-child(2) {
    animation-delay: 0.5s;
}

.logo-emoji:nth-child(3) {
    animation-delay: 1s;
}

.logo-emoji:hover {
    transform: scale(1.2) rotate(10deg);
}

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

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.lang-switcher a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
}

.lang-switcher a:hover {
    color: var(--accent);
    border-color: var(--border);
}


#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background-color: var(--bg-secondary);
    transform: rotate(20deg) scale(1.1);
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.3);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(220, 38, 38, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(249, 115, 22, 0.08) 0%, transparent 50%);
    animation: gradientRotate 20s linear infinite;
    pointer-events: none;
}

@keyframes gradientRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.profile-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 2rem;
    display: block;
    border: 4px solid transparent;
    background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
                linear-gradient(135deg, var(--gradient-start), var(--gradient-end)) border-box;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.2),
                0 0 0 0 rgba(220, 38, 38, 0.4);
    animation: fadeInUp 0.8s ease-out, profilePulse 3s ease-in-out infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
}

.profile-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 48px rgba(220, 38, 38, 0.3),
                0 0 0 10px rgba(220, 38, 38, 0.1);
}

@keyframes profilePulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(220, 38, 38, 0.2),
                    0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(220, 38, 38, 0.3),
                    0 0 0 15px rgba(220, 38, 38, 0);
    }
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero .title {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out 0.3s both, gradientShift 3s ease infinite;
}

.hero .tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.hero-buttons .btn:nth-child(1) {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-buttons .btn:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero-buttons .btn:nth-child(3) {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    background-size: 200% 200%;
    color: white;
    animation: gradientShift 3s ease infinite;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
    animation: gradientShift 1.5s ease infinite, pulse 2s ease infinite;
}

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

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.hero-info {
    display: flex;
    gap: 2rem;
    justify-content: center;
    color: var(--text-secondary);
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.9s both;
}

/* Sections */
section {
    padding: 4rem 0;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    width: 100%;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 2px;
    transition: width 0.3s ease;
}

section h2:hover::after {
    width: 120px;
}

/* About Section */
.about {
    background-color: var(--bg-secondary);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(220, 38, 38, 0.03) 50%, transparent 100%);
    pointer-events: none;
}

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

.about-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

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

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

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

.skill-tags span {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tags span:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
}

/* Experience Section */
.experience {
    background-color: var(--bg-secondary);
}

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

.timeline-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    transition: transform 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(8px);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 150px;
    top: 0;
    bottom: -3rem;
    width: 2px;
    background-color: var(--border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-date {
    font-weight: 600;
    color: var(--accent);
    padding-top: 0.25rem;
}

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

.timeline-content h4 {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.company-type {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.timeline-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.timeline-content li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.tech-stack {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: float 6s ease-in-out infinite;
}

.project-card:nth-child(1) {
    animation-delay: 0s;
}

.project-card:nth-child(2) {
    animation-delay: 1s;
}

.project-card:nth-child(3) {
    animation-delay: 2s;
}

.project-card:nth-child(4) {
    animation-delay: 3s;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 12px 32px var(--shadow);
    border-color: var(--accent);
}

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

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

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

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

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

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

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.125rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-item:hover {
    background-color: var(--bg-primary);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* Footer */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    nav ul {
        gap: 1rem;
    }

    nav a {
        font-size: 0.875rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

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

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

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

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

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .timeline-item::before {
        display: none;
    }

    footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    nav ul {
        display: none;
    }

    .header-content {
        justify-content: space-between;
    }
}

/* Keyframe Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

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

/* Scroll-triggered animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

