/* CSS Variables for theming */
:root {
    --accent: #FF7A00;
    --base: #1F1F1F;
    --text-color: #FFFFFF;
    --bg: #ffffff;
    --surface: #f8fafc;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Dark theme */
[data-theme="dark"] {
    --bg: var(--base);
    --surface: #1e293b;
    --text: var(--text-color);
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* System dark mode preference - only apply when no theme is manually set */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #0f172a;
        --surface: #1e293b;
        --text: #f1f5f9;
        --text-secondary: #94a3b8;
        --border: #334155;
        --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    }
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth transitions for all elements */
*,
*::before,
*::after {
    transition: 
        color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        fill 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        stroke 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.nav-logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent);
    text-decoration: none;
}

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

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

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.theme-toggle:hover {
    background: var(--surface);
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.theme-toggle:active {
    transform: scale(0.98);
}

.theme-icon {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.theme-toggle.switching .theme-icon {
    transform: rotateY(180deg) scale(1.2);
}

/* Theme transition overlay */
.theme-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at var(--click-x, 50%) var(--click-y, 50%), 
                var(--accent) 0%, 
                transparent 100%);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: scale(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-transition-overlay.active {
    opacity: 0.8;
    transform: scale(3);
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered animations for grid items */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .theme-toggle.switching .theme-icon {
        transform: none;
    }
    
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .scale-in,
    .stagger-item {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    text-align: center;
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
}

.hero-avatar {
    margin-bottom: 2rem;
}

.hero-name {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text);
}

.hero-headline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-location {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #FF8C1A;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

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

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

.btn-outline:hover {
    background: var(--surface);
    transform: translateY(-2px);
}

.hero-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.hero-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* Sections */
.section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border);
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text);
}

/* Summary */
.summary-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 800px;
}

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

.highlight {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.highlight-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.highlight-number.counting {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

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

.highlight-label {
    color: var(--text-secondary);
}

/* Skills */
.skills-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.filter-chip.active,
.filter-chip:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text);
    transition: all 0.3s ease;
}

.skill-tag.highlighted {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.timeline-item {
    padding-left: 2rem;
    border-left: 2px solid var(--border);
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.timeline-header {
    margin-bottom: 1rem;
}

.timeline-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.company {
    color: var(--accent);
    font-weight: 600;
    margin-right: 1rem;
}

.dates {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.achievement-list {
    list-style: none;
    padding-left: 0;
}

.achievement-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.achievement-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

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

.project-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 122, 0, 0.1), transparent);
    transition: left 0.6s ease;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow: 
        var(--shadow-lg),
        0 20px 40px rgba(255, 122, 0, 0.15);
    border: 1px solid rgba(255, 122, 0, 0.2);
}

.project-card:hover .project-tech {
    transform: translateY(-5px);
}

.project-card:hover h3 {
    color: var(--accent);
    transform: translateX(5px);
}

.project-card:active {
    transform: translateY(-4px) scale(0.98);
}

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

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

.project-impact {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

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

.tech-tag {
    padding: 0.25rem 0.75rem;
    background: var(--accent);
    color: white;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Certifications */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.cert-item {
    padding: 1rem;
    background: var(--surface);
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 500;
    color: var(--text);
    border: 1px solid var(--border);
}

/* Education */
.education-item {
    margin-bottom: 2rem;
}

.education-item h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.education-item p {
    color: var(--text-secondary);
}

.languages {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.language {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: 0.5rem;
    color: var(--text);
    border: 1px solid var(--border);
}

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

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-label {
    font-weight: 600;
    color: var(--text);
}

.contact-value {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-value a {
    color: var(--accent);
    text-decoration: none;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--surface);
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-name {
        font-size: 2rem;
    }
    
    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }
    
    .highlights {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .nav,
    .theme-toggle,
    .hero-ctas,
    .skills-filter,
    .copy-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero {
        padding: 2rem 0 1rem;
    }
    
    .section {
        padding: 1.5rem 0;
        border-bottom: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .hero-name {
        font-size: 2rem;
    }
    
    .hero-headline {
        font-size: 1rem;
    }
    
    .project-card,
    .highlight {
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
    
    .timeline-item {
        border-left-color: #ccc;
    }
    
    .timeline-item::before {
        background: #666;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
}

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}