/* Modern Portfolio CSS */
:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark theme (default) */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

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

*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 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;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Hide scrollbars */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
}

/* Firefox */
html {
    scrollbar-width: none;
}

/* IE and Edge */
body {
    -ms-overflow-style: none;
}

/* Cosmic background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, rgba(99, 102, 241, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(139, 92, 246, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(99, 102, 241, 0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(139, 92, 246, 0.3), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(99, 102, 241, 0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(2px 2px at 20px 30px, rgba(99, 102, 241, 0.1), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(139, 92, 246, 0.08), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(99, 102, 241, 0.12), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(139, 92, 246, 0.1), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(99, 102, 241, 0.08), transparent);
}

/* Theme Toggle */
.theme-toggle-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

/* Mobile Theme Toggle */
@media (max-width: 768px) {
    .theme-toggle-container {
        top: 1rem;
        right: 1rem;
    }
}

.theme-toggle {
    width: 60px;
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: 15px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
    box-shadow: var(--shadow-lg);
}

.toggle-slider {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .toggle-slider {
    transform: translateX(30px);
}

.toggle-icon {
    color: white;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

[data-theme="light"] .toggle-icon i::before {
    content: "\f185"; /* sun icon */
}

/* Profile Header */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 2rem 1rem 3rem;
    text-align: center;
    position: relative;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    display: block;
}

/* Hide profile header on desktop */
@media (min-width: 1024px) {
    .profile-header {
        display: none;
    }
}

/* Pull-to-Refresh Loading State */
.profile-header.loading {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* Glowing Orb Animation */
.glow-orb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.8), rgba(236, 72, 153, 0.6), rgba(255, 255, 255, 0.4));
    box-shadow: 
        0 0 20px rgba(147, 51, 234, 0.6),
        0 0 40px rgba(147, 51, 234, 0.4),
        0 0 60px rgba(147, 51, 234, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-header.loading .glow-orb {
    opacity: 1;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 
            0 0 20px rgba(147, 51, 234, 0.6),
            0 0 40px rgba(147, 51, 234, 0.4),
            0 0 60px rgba(147, 51, 234, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 
            0 0 30px rgba(147, 51, 234, 0.8),
            0 0 50px rgba(147, 51, 234, 0.6),
            0 0 70px rgba(147, 51, 234, 0.4);
    }
}

/* Skeleton Loading Placeholders */
.skeleton {
    background: linear-gradient(90deg, 
        var(--bg-secondary) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.skeleton-title {
    height: 24px;
    width: 40%;
    margin-bottom: 1rem;
}

.skeleton-item {
    height: 12px;
    width: 100%;
    margin-bottom: 6px;
}

.skeleton-tag {
    height: 28px;
    width: 80px;
    border-radius: 14px;
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
}

/* Loading State for Cards */
.card.loading {
    opacity: 0.7;
}

.card.loading .card-title,
.card.loading .profile-name,
.card.loading .profile-role,
.card.loading .contact-item,
.card.loading .tech-tag {
    color: transparent;
    background: linear-gradient(90deg, 
        var(--bg-secondary) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.profile-header-content {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Desktop Layout */
@media (min-width: 1024px) {
    .main-container {
        flex-direction: row;
        gap: 2rem;
        padding: 2rem 1rem;
        align-items: flex-start;
    }
}

/* Left Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 2rem;
    width: 100%;
}

/* Desktop Sidebar */
@media (min-width: 1024px) {
    .sidebar {
        width: 350px;
        flex-shrink: 0;
        position: sticky;
        top: 2rem;
        max-height: calc(100vh - 4rem);
    }
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    padding-right: 100px; /* Space for theme toggle */
    flex: 1;
}

/* Desktop Main Content */
@media (min-width: 1024px) {
    .main-content {
        padding-right: 0;
        flex: 1;
        min-width: 0;
    }
}

/* Desktop Only Elements */
.desktop-only {
    display: none;
}

@media (min-width: 1024px) {
    .desktop-only {
        display: block;
    }
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    margin-bottom: 0;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    opacity: 0.9;
    border-radius: 20px 20px 0 0;
    z-index: 1;
}

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

.card:hover::before {
    opacity: 1;
}

/* Profile Header Styling */
.profile-image-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    text-transform: uppercase;
}

.profile-role {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-weight: 500;
}

.download-cv-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    font-size: 0.95rem;
}

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

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

/* Card Titles */
.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.5rem;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Contact Card */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.contact-item i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Technologies Card */
.tech-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tech-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

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

.tech-tag {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

/* Content Sections (without cards) */
.content-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* About Content */
.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    font-weight: 400;
}

/* Experience Card */
.experience-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.job-card {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.job-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.job-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.company-logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.job-info {
    flex: 1;
}

.job-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.company-name {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.job-period {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.job-skills {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-tag {
    background: var(--bg-secondary);
    color: var(--primary-color);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.job-description {
    list-style: none;
    padding: 0;
}

.job-description li {
    padding: 0.4rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

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

/* Education Card */
.education-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.education-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.education-info {
    flex: 1;
}

.degree {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.education-period {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .main-container {
        padding: 0 1.5rem 2rem;
    }
}

@media (max-width: 968px) {
    .profile-header {
        padding: 1.5rem 1rem 2rem;
    }
    
    .main-container {
        padding: 0 1rem 2rem;
        gap: 1rem;
    }
    
    .profile-image-container {
        width: 100px;
        height: 100px;
    }
    
    .profile-name {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .profile-header {
        padding: 1rem 0.75rem 2rem;
    }
    
    .main-container {
        padding: 0 0.75rem 2rem;
    }
    
    .theme-toggle {
        width: 50px;
        height: 25px;
    }
    
    .toggle-slider {
        width: 20px;
        height: 20px;
    }
    
    [data-theme="light"] .toggle-slider {
        transform: translateX(25px);
    }
    
    .card {
        padding: 1rem;
    }
    
    .profile-name {
        font-size: 1.6rem;
    }
    
    .profile-image-container {
        width: 90px;
        height: 90px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .job-header,
    .education-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .company-logo,
    .education-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .tech-tags {
        gap: 0.4rem;
    }
    
    .tech-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 0.5rem;
    }
    
    .main-content {
        padding-right: 70px; /* Even smaller space for mobile */
    }
    
    .card {
        padding: 1rem;
    }
    
    .profile-name {
        font-size: 1.4rem;
    }
    
    .profile-image-container {
        width: 80px;
        height: 80px;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .download-cv-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .tech-tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .contact-item {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .about-content p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .job-description li {
        font-size: 0.9rem;
        padding-left: 1rem;
    }
    
    .skill-tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Additional mobile improvements */
@media (max-width: 360px) {
    .main-container {
        padding: 0.25rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .profile-name {
        font-size: 1.2rem;
    }
    
    .profile-image-container {
        width: 70px;
        height: 70px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .main-content {
        padding-right: 60px;
    }
}