:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #0ea5e9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --background: #ffffff;
    --surface: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --secondary-color: #94a3b8;
    --accent-color: #06b6d4;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --background: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--surface);
    font-size: 16px;
    transition: all 0.3s ease;
}

/* Loading Screen */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--background);
    color: var(--text-primary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Main Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--background);
    box-shadow: var(--shadow-lg);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Header Styles */
.header {
    background: var(--gradient);
    color: white;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.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 1000 100" fill="white" fill-opacity="0.1"><polygon points="0,100 1000,0 1000,100"/></svg>') no-repeat;
    background-size: cover;
    pointer-events: none;
}

.profile-section {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    min-width: 300px;
}

.profile-image {
    font-size: 5rem;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border: 4px solid #fff;
    background: #f3f4f6;
    display: block;
    margin: 0 auto;
}

.profile-info {
    flex: 1;
}

.name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.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: 0.5rem;
}

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

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

.contact-item a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

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

.header-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Navigation */
.nav-menu {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

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

.section {
    margin-bottom: 3rem;
    background: white;
    background: var(--background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.section-title i {
    font-size: 1.25rem;
    color: var(--accent-color);
}

.section-content {
    font-size: 1rem;
    line-height: 1.7;
}

.subsection {
    margin-bottom: 2rem;
}

.subsection:last-child {
    margin-bottom: 0;
}

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

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

.skill-category h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

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

.skill-tag {
    background: var(--gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.skill-tag:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Experience Section */
.experience-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.experience-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

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

.job-info {
    flex: 1;
}

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

.company-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.company {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 1rem;
}

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

.duration {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--surface);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    white-space: nowrap;
}

.achievements {
    list-style: none;
    padding: 0;
}

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

.achievements li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-size: 0.75rem;
}

/* Education Section */
.education-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.education-item h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.institution, .year, .gpa {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

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

.cert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.cert-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.cert-item:hover .cert-icon i {
    color: white;
}

.cert-item:hover .cert-info * {
    color: white;
}

.cert-icon {
    font-size: 2rem;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.cert-info h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.cert-issuer, .cert-date, .cert-id {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* Projects Section */
.project-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.project-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

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

.project-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    flex: 1;
}

.project-duration {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--surface);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    white-space: nowrap;
}

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

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: var(--surface);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

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

.project-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.project-link a:hover {
    color: var(--accent-color);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-note {
    font-style: italic;
    opacity: 0.8;
}

.visitor-counter {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    width: 100%;
    margin-top: 0.5rem;
}

.visitor-counter i {
    margin-right: 0.3rem;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--background);
}

.progress-dot:hover,
.progress-dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
}

/* Error Message */
.error-message {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--background);
    color: var(--text-primary);
}

.error-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.error-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.error-content button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .progress-indicator {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 0;
        box-shadow: none;
    }

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

    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-image {
        font-size: 4rem;
    }

    .name {
        font-size: 2rem;
    }

    .title {
        font-size: 1.1rem;
    }

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

    .header-actions {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

    .section {
        padding: 1.5rem;
    }

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

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

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

    .nav-menu {
        padding: 0 1rem;
    }

    .nav-link {
        padding: 1rem;
    }

    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .name {
        font-size: 1.75rem;
    }

    .profile-image {
        font-size: 3rem;
    }

    .section {
        margin-bottom: 2rem;
        padding: 1rem;
    }

    .contact-item {
        font-size: 0.85rem;
    }

    .header-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

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

    .theme-toggle,
    .progress-indicator {
        display: none !important;
    }

    .nav-menu {
        display: none;
    }

    .header {
        background: #2563eb !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
        page-break-after: avoid;
    }

    .section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
        page-break-inside: avoid;
    }

    .skill-tag {
        background: #2563eb !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }

    .header-actions {
        display: none;
    }
}

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