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

:root {
    /* Light Theme Colors */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-light: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-medium: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-large: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-tech: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-medium: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    
    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Dark Theme */
[data-theme="dark"] {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #374151;
    --border-color: #4b5563;
    --shadow-light: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-medium: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-large: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Base Typography */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition-medium);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-xl);
    }
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition-medium);
}

[data-theme="dark"] .nav {
    background: rgba(17, 24, 39, 0.95);
}

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

.nav-logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: none;
    align-items: center;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }
}

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

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-fast);
}

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

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 44px;
    height: 24px;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    margin-left: var(--space-md);
}

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

.theme-icon {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    transition: var(--transition-medium);
}

[data-theme="dark"] .theme-icon {
    transform: translateX(18px);
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    gap: 4px;
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: var(--transition-fast);
}

/* Section Styles */
section {
    padding: var(--space-3xl) 0;
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-3xl);
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    align-items: center;
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3xl);
    }
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: var(--font-size-5xl);
    }
}

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

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

@media (min-width: 640px) {
    .hero-buttons {
        flex-direction: row;
        gap: var(--space-lg);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: var(--font-size-base);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

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

/* Hero Image */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-avatar {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image-placeholder {
    width: 200px;
    height: 200px;
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-large);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--font-size-lg);
    text-align: center;
    transition: var(--transition-medium);
    overflow: hidden;
}

.hero-image-placeholder:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

/* Keep the old avatar-placeholder for backwards compatibility */
.avatar-placeholder {
    width: 200px;
    height: 200px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-large);
}

.floating-icons {
    position: absolute;
    inset: 0;
}

.icon-item {
    position: absolute;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    box-shadow: var(--shadow-medium);
}

.icon-item.ios {
    top: 20px;
    right: 20px;
    color: #007AFF;
}

.icon-item.android {
    bottom: 20px;
    left: 20px;
    color: #3DDC84;
}

.icon-item.flutter {
    top: 40px;
    left: 0px;
    color: #02569B;
}

[data-theme="dark"] .icon-item.flutter {
    color: #4FC3F7;
}

.icon-item.kotlin {
    bottom: 40px;
    right: 0px;
    color: #7F52FF;
}

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

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

@media (min-width: 1024px) {
    .about-content {
        grid-template-columns: 2fr 1fr;
        gap: var(--space-3xl);
    }
}

.about-text p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.highlight-item {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-light);
    transition: var(--transition-fast);
}

.highlight-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.highlight-number {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-sm);
}

.highlight-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.about-profile {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.profile-image {
    width: 150px;
    height: 150px;
    position: relative;
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--font-size-lg);
    text-align: center;
    box-shadow: var(--shadow-large);
    transition: var(--transition-medium);
    border: 3px solid var(--border-color);
    overflow: hidden;
}

.profile-placeholder:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-large);
}

.about-card {
    background: var(--bg-card);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
}

.about-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.about-card ul {
    list-style: none;
}

.about-card li {
    padding: var(--space-sm) 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: var(--space-lg);
}

.about-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 600;
}

/* Skills Section */
.skills {
    background: var(--bg-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.skill-category {
    background: var(--bg-card);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-large);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.category-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.category-icon {
    color: var(--primary-color);
    transition: var(--transition-fast);
}

.skill-category:hover .category-icon {
    color: var(--primary-hover);
    transform: scale(1.1);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.skill-tag {
    background: transparent;
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition-fast);
    cursor: default;
    white-space: nowrap;
}

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

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

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.project-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-large);
    border-color: var(--primary-color);
}

.project-content {
    padding: var(--space-2xl);
}

.project-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    line-height: 1.3;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
    font-size: var(--font-size-base);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.tech-tag {
    background: var(--primary-color);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border: 1.5px solid var(--primary-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 600;
    transition: var(--transition-fast);
}

.tech-tag:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
}

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

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

@media (min-width: 1024px) {
    .contact-content {
        grid-template-columns: 2fr 1fr;
        gap: var(--space-3xl);
    }
}

.contact-text h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.contact-text p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.contact-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

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

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

.contact-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 640px) {
    .contact-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .contact-links {
        grid-template-columns: 1fr;
    }
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.social-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.social-icon-img {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    transition: var(--transition-fast);
}

.social-link:hover .social-icon-img {
    transform: scale(1.1);
}

.social-icon.github {
    background: #333;
    color: white;
}

.social-icon.linkedin {
    background: #0077B5;
    color: white;
}

.social-icon.twitter {
    background: #1DA1F2;
    color: white;
}

.social-icon.email {
    background: var(--accent-color);
    color: white;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

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

.footer p:last-child {
    margin-bottom: 0;
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Scroll animations will be handled by JavaScript */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
}

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

/* Mobile Menu Styles */
@media (max-width: 767px) {
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: var(--space-xl);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-large);
        transform: translateY(-100%);
        transition: var(--transition-medium);
        opacity: 0;
        visibility: hidden;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        padding: var(--space-md) 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .theme-toggle {
        margin-left: 0;
        margin-top: var(--space-md);
    }
}

/* Responsive Typography */
@media (max-width: 640px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .hero-description {
        font-size: var(--font-size-base);
    }
}

/* Focus States for Accessibility */
.btn:focus,
.nav-link:focus,
.theme-toggle:focus,
.project-link:focus,
.social-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}