/* CSS Variables for theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #0a0a0a;
    --text-secondary: #6b7280;
    --border-color: #e5e5e5;
    --accent-blue: #2563eb;
    --accent-cyan: #06b6d4;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #171717;
    --bg-card: #171717;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --border-color: #262626;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

[data-theme="dark"] .header {
    background-color: rgba(10, 10, 10, 0.95);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: none;
    gap: 1.5rem;
}

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

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

.theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.1);
}

.sun-icon {
    display: none;
}

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

.moon-icon {
    display: block;
}

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

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

/* Sections */
section {
    padding: 5rem 1rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Introduction Section */
.section-introduction {
    padding-top: 7rem;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.intro-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, var(--accent-blue), var(--accent-cyan));
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

.avatar-img {
    position: relative;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    border: 4px solid var(--bg-primary);
    box-shadow: var(--shadow-xl);
    object-fit: cover;
    object-position: top;
}

.intro-text {
    flex: 1;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.intro-name {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-title {
    font-size: 1.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.intro-bio {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 2rem;
    max-width: 42rem;
}

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

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

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

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

.btn-secondary:hover {
    background-color: var(--bg-secondary);
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-link {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.2s;
}

.social-link:hover {
    background-color: #dbeafe;
    transform: translateY(-2px);
}

[data-theme="dark"] .social-link:hover {
    background-color: #1e3a8a;
}

@media (min-width: 768px) {
    .intro-content {
        flex-direction: row;
    }
    .intro-text {
        text-align: left;
    }
    .intro-info,
    .intro-buttons,
    .social-links {
        justify-content: flex-start;
    }
}

/* Skills Section */
.section-skills {
    background-color: rgba(245, 245, 245, 0.3);
}

[data-theme="dark"] .section-skills {
    background-color: rgba(23, 23, 23, 0.3);
}

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

.skill-card {
    padding: 1.5rem;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.3s;
}

.skill-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.5);
}

.skill-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

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

.tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: #dbeafe;
}

[data-theme="dark"] .tag:hover {
    background-color: #1e3a8a;
}

/* Experience Section */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-blue), var(--accent-cyan));
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-dot {
    position: absolute;
    left: -3rem;
    top: 1.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: var(--accent-blue);
    border: 4px solid var(--bg-primary);
    z-index: 10;
}

.experience-card {
    padding: 1.5rem;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.3s;
}

.experience-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(37, 99, 235, 0.5);
}

.experience-header {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.experience-icon {
    width: fit-content;
    height: fit-content;
    padding: 0.5rem;
    background: linear-gradient(to bottom right, #dbeafe, #cffafe);
    border-radius: var(--radius);
    color: var(--accent-blue);
}

[data-theme="dark"] .experience-icon {
    background: linear-gradient(to bottom right, #1e3a8a, #164e63);
}

.experience-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.company {
    font-size: 1.125rem;
    color: var(--accent-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

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

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

.tech-tag {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    .timeline {
        padding-left: 0;
    }
    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }
    .timeline-item:nth-child(even) .experience-card {
        margin-left: auto;
    }
    .timeline-item .experience-card {
        max-width: calc(50% - 2rem);
    }
    .timeline-dot {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Volunteer Section */
.section-volunteer {
    background-color: rgba(245, 245, 245, 0.3);
}

[data-theme="dark"] .section-volunteer {
    background-color: rgba(23, 23, 23, 0.3);
}

.volunteer-card {
    padding: 1.5rem;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    gap: 1rem;
    transition: all 0.3s;
}

.volunteer-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(37, 99, 235, 0.5);
}

.volunteer-icon {
    padding: 0.75rem;
    background: linear-gradient(to bottom right, #dbeafe, #cffafe);
    border-radius: var(--radius);
    color: var(--accent-blue);
    height: fit-content;
}

[data-theme="dark"] .volunteer-icon {
    background: linear-gradient(to bottom right, #1e3a8a, #164e63);
}

.volunteer-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

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

.award-card {
    padding: 1.5rem;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.3s;
}

.award-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(37, 99, 235, 0.5);
    transform: translateY(-4px);
}

.award-icon {
    padding: 0.75rem;
    background: linear-gradient(to bottom right, #dbeafe, #cffafe);
    border-radius: var(--radius);
    color: var(--accent-blue);
    display: inline-flex;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

[data-theme="dark"] .award-icon {
    background: linear-gradient(to bottom right, #1e3a8a, #164e63);
}

.award-card:hover .award-icon {
    transform: scale(1.1);
}

.award-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.award-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.rank {
    font-weight: 600;
    color: var(--accent-blue);
}

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

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

.award-content p {
    color: var(--text-secondary);
}

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

.project-card {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
}

.project-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(37, 99, 235, 0.5);
}

.project-image {
    position: relative;
    overflow: hidden;
    height: 12rem;
}

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

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

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

.project-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-outline,
.btn-filled {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-outline:hover {
    background-color: var(--bg-secondary);
}

.btn-filled {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border: none;
}

.btn-filled:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Footer */
.footer {
    background-color: rgba(245, 245, 245, 0.5);
    border-top: 1px solid var(--border-color);
    padding: 3rem 1rem;
}

[data-theme="dark"] .footer {
    background-color: rgba(23, 23, 23, 0.5);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.footer-section h4 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

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

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

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: var(--text-primary);
    transition: color 0.2s;
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-copyright {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.1);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.screenshot-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--border-color);
}

.screenshot-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-blue);
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
}

.screenshot-number {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.screenshot-counter {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.screenshot-counter span {
    color: var(--text-primary);
    font-weight: 700;
}

/* Fullscreen Image Viewer */
.fullscreen-viewer {
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.fullscreen-viewer.active {
    display: flex;
}

.fullscreen-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
}

.fullscreen-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fullscreen-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.fullscreen-nav.prev {
    left: 1rem;
}

.fullscreen-nav.next {
    right: 1rem;
}

.fullscreen-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .intro-name {
        font-size: 2rem;
    }
    .intro-title {
        font-size: 1.5rem;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .timeline {
        padding-left: 2rem;
    }
    .timeline::before {
        left: 1rem;
    }
    .timeline-dot {
        left: -2.5rem;
    }
}