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

:root {
    --primary-color: #16c99c;
    --primary-dark: #002fb0;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #64748b;
    --background: #ffffff;
    --background-alt: #f8fafc;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --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);
    --gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.2s ease-in-out;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --primary-color: #16c99c;
    --primary-dark: #3b82f6;
    --secondary-color: #94a3b8;
    --accent-color: #fbbf24;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    --background: #0f172a;
    --background-alt: #1e293b;
    --border-color: #334155;
    --border-light: #1e293b;
    --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);
    --gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

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

[data-theme="dark"] .header {
    background: var(--gradient);
}

[data-theme="dark"] .header::before {
    opacity: 0.5;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    background-color: var(--background);
    box-shadow: var(--shadow-lg);
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--gradient);
    color: white;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="80" cy="80" r="1" fill="white" opacity="0.1"/><circle cx="40" cy="60" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.profile-photo {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.profile-photo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.profile-photo img:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.header-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.title {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.contact-item i {
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

.contact-item a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Navigation */
.navigation {
    background-color: var(--background-alt);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

/* Main Content */
.main-content {
    padding: 2rem;
}

/* Sections */
.section {
    margin-bottom: 3rem;
    scroll-margin-top: 100px;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.section-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* About Section */
#about .section-content p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

/* Experience Section */
.experience-item {
    background-color: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.experience-item:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.job-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.company-period {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.company {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

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

.job-description {
    list-style: none;
    margin: 1.5rem 0;
}

.job-description li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.job-description li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tech-tag {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Education Section */
.education-item {
    background-color: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.degree {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.school-period {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.school {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.education-details {
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.coursework {
    color: var(--text-secondary);
    margin-top: 1rem;
}

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

.skill-category {
    background-color: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.skill-category:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}

.skill-category h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h4::before {
    content: '●';
    color: var(--primary-color);
}

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

.skill-item {
    background-color: var(--background-alt);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.skill-item:hover {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Projects Section */
.project-item {
    background-color: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.project-item:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

.project-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.project-link:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.project-link:nth-child(2) {
    background-color: var(--accent-color);
}

.project-link:nth-child(2):hover {
    background-color: #d97706;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info-detailed h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.contact-info-detailed p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-method {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-method i {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-top: 0.25rem;
    width: 20px;
}

.contact-method div strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-method div p {
    color: var(--text-secondary);
    margin: 0;
}

/* Contact Form */
.contact-form {
    background-color: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.contact-form h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--background);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

.submit-btn:active {
    transform: translateY(0);
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 50%;
    transition: var(--transition);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .header {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }

    .profile-photo img {
        width: 120px;
        height: 120px;
    }

    .name {
        font-size: 2rem;
    }

    .contact-info {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .navigation ul {
        gap: 1rem;
        padding: 1rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

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

    .experience-header,
    .education-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .company-period,
    .school-period {
        align-items: flex-start;
        text-align: left;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .profile-photo img {
        width: 100px;
        height: 100px;
    }

    .name {
        font-size: 1.75rem;
    }

    .navigation ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .experience-item,
    .education-item,
    .project-item,
    .skill-category,
    .contact-form {
        padding: 1.5rem;
    }

    .project-links {
        flex-direction: column;
    }

    .technologies,
    .skill-list {
        gap: 0.25rem;
    }

    .tech-tag,
    .skill-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Print Styles */
@media print {

    .navigation,
    .contact-form,
    .footer {
        display: none;
    }

    .container {
        box-shadow: none;
        max-width: none;
    }

    .header {
        background: none;
        color: var(--text-primary);
        page-break-after: avoid;
    }

    .section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .experience-item,
    .education-item,
    .project-item {
        page-break-inside: avoid;
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

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

/* Scroll-to-top button (if added via JS) */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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