:root {
    --primary-color: #3182ce;
    --secondary-color: #805ad5;
    --accent-color: #38a169;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #ffffff;
    --bg-color-rgb: 255, 255, 255;
    --bg-alt: #f7fafc;
    --shadow: rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #63b3ed;
    --secondary-color: #9f7aea;
    --accent-color: #68d391;
    --text-color: #f7fafc;
    --text-light: #cbd5e0;
    --bg-color: #0f1419;
    --bg-color-rgb: 15, 20, 25;
    --bg-alt: #1a202c;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(var(--bg-color-rgb), 0.9);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    padding: 15px 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-brand .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 15px;
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--border-radius);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--primary-color);
    transform: rotate(30deg);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    height: 24px;
    width: 30px;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    width: 100%;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

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

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

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

.hero-image {
    display: flex;
    justify-content: center;
}

.profile-container {
    position: relative;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.03);
}

#fallbackAvatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

.section-alt {
    background-color: var(--bg-alt);
}

/* About Section */
.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-text {
    flex: 2;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-stats {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-item {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px var(--shadow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.skill-item {
    background-color: var(--bg-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px var(--shadow);
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.skill-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.skill-level {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background-color: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 5px;
    left: -43px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid var(--bg-color);
}

.timeline-content {
    background-color: var(--bg-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px var(--shadow);
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.timeline-company {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 1rem;
}

.timeline-description {
    line-height: 1.7;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow);
}

.project-image {
    height: 200px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.project-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
    margin: 0;
}

.project-content {
    padding: 25px;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.project-description {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    background-color: var(--bg-alt);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

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

/* Contact Section */
.contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-description {
    font-size: 1.1rem;
    margin-bottom: 40px;
    line-height: 1.8;
}

.contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 4px 6px var(--shadow);
    transition: var(--transition);
}

.contact-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px var(--shadow);
    color: var(--primary-color);
}

.contact-icon {
    font-size: 1.2rem;
}

.contact-label {
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    background-color: var(--bg-alt);
    color: var(--text-light);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(var(--bg-color-rgb), 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .profile-container {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero-actions {
        justify-content: center;
    }

    .profile-container {
        width: 300px;
        height: 300px;
    }

    .about-content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 10px 15px var(--shadow);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-link {
        padding: 15px;
    }

    .nav-toggle {
        display: flex;
    }

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

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .section {
        padding: 70px 0;
    }

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

    .timeline {
        padding-left: 30px;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-item::before {
        left: -33px;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
    }

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

    .profile-container {
        width: 250px;
        height: 250px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-link {
        width: 100%;
        justify-content: center;
    }
}

/* Image Modal */
.image-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    transition: opacity 0.2s;
}

.image-modal .modal-content {
    margin: 40px 0 20px 0;
    max-width: 90vw;
    max-height: 70vh;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    background: #fff;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #ff4b5c;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color, #3182ce);
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    transition: background 0.2s;
}

.download-btn:hover {
    background: var(--secondary-color, #805ad5);
    color: #fff;
}