/* ===============================================
   MODERN PORTFOLIO CSS - SHIVAM GARG
   =============================================== */

/* =============== CSS Variables =============== */
:root {
    /* Light Theme Colors */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'Fira Code', 'Courier New', monospace;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-preloader: 9999;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-color: #818cf8;
    --secondary-color: #a78bfa;
    --accent-color: #f472b6;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-light: #cbd5e0;
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #374151;
    --border-color: #4a5568;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    font-size: 16px; /* Base font size for responsive scaling */
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden; /* Prevent horizontal scroll */
    min-width: 320px; /* Minimum width for very small devices */
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* =============== Preloader =============== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-preloader);
    transition: opacity 0.5s, visibility 0.5s;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.loader-text {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.loader-text span {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    animation: bounce 1.5s ease-in-out infinite;
}

.loader-text span:nth-child(1) { animation-delay: 0s; }
.loader-text span:nth-child(2) { animation-delay: 0.1s; }
.loader-text span:nth-child(3) { animation-delay: 0.2s; }
.loader-text span:nth-child(4) { animation-delay: 0.3s; }
.loader-text span:nth-child(5) { animation-delay: 0.4s; }
.loader-text span:nth-child(6) { animation-delay: 0.5s; }

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar::after {
    content: '';
    display: block;
    width: 0;
    height: 100%;
    background: white;
    animation: loading 2s linear forwards;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes loading {
    to { width: 100%; }
}

/* =============== Custom Cursor =============== */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.2s, width 0.2s, height 0.2s;
    z-index: 9998;
    mix-blend-mode: difference;
}

.cursor-follower {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.3s;
    z-index: 9997;
}

.cursor.hover {
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%) scale(1.5);
}

@media (max-width: 768px) {
    .cursor, .cursor-follower {
        display: none;
    }
}

/* =============== Navigation =============== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--shadow-color);
    z-index: var(--z-sticky);
    transition: all var(--transition-normal);
}

[data-theme="dark"] .navbar {
    background: rgba(26, 32, 44, 0.95);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 30px var(--shadow-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-extras {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.theme-toggle:hover {
    transform: rotate(20deg);
}

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

.nav-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

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

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

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        gap: 1.5rem;
        transition: left var(--transition-normal);
        box-shadow: 0 5px 20px var(--shadow-color);
        overflow-y: auto; /* Allow scrolling if menu is too long */
        z-index: var(--z-fixed);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.5rem 0;
        display: block;
        width: 100%;
    }

    .nav-link::after {
        bottom: 0;
    }
}

/* Tablet Navigation Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-menu {
        gap: 1.5rem;
    }

    .nav-link {
        font-size: 0.95rem;
    }
}

/* =============== Side Navigation Dots =============== */
.side-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: var(--z-fixed);
}

.side-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.side-nav-dot::before {
    content: attr(data-section);
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-tertiary);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.side-nav-dot:hover::before {
    opacity: 1;
}

.side-nav-dot.active {
    background: var(--primary-color);
    transform: scale(1.5);
}

/* Show side nav on tablet and above, hide on mobile */
@media (max-width: 767px) {
    .side-nav {
        display: none;
    }
}

/* Adjust side nav for tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .side-nav {
        right: 20px;
    }

    .side-nav-dot {
        width: 10px;
        height: 10px;
    }
}

/* =============== Social Sidebar =============== */
.social-sidebar {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: var(--z-fixed);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all var(--transition-normal);
}

.social-link:hover {
    color: white;
    transform: translateY(-5px);
}

.social-link:hover::before {
    width: 100%;
    height: 100%;
}

.social-link i {
    position: relative;
    z-index: 1;
}

/* Show social sidebar on tablet and above, hide on mobile */
@media (max-width: 767px) {
    .social-sidebar {
        display: none;
    }
}

/* Adjust social sidebar for tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .social-sidebar {
        left: 20px;
    }

    .social-link {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* =============== Hero Section =============== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.gradient-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-text {
    animation: fadeInUp 1s ease;
}

.hero-greeting {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.typewriter {
    display: inline-block;
    position: relative;
}

.cursor-blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-roles {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.role-text {
    margin-right: 0.5rem;
}

.roles-carousel {
    color: var(--secondary-color);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

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

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

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

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

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

.image-container {
    position: relative;
}

.image-wrapper {
    position: relative;
    width: 350px;
    height: 350px;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--bg-primary);
    box-shadow: 0 20px 60px var(--shadow-color);
    display: block; /* Prevent inline spacing issues */
}

.image-decoration {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    pointer-events: none;
}

.decoration-ring {
    width: 100%;
    height: 100%;
    animation: rotate 20s linear infinite;
}

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

.status-badge {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 5px 20px var(--shadow-color);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    animation: bounce-scroll 2s infinite;
}

@keyframes bounce-scroll {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 3px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 2s infinite;
}

@keyframes scroll-wheel {
    0% { opacity: 1; top: 8px; }
    50% { opacity: 0.5; top: 15px; }
    100% { opacity: 0; top: 20px; }
}

/* =============== Section Styles =============== */
section {
    padding: 80px 0;
    position: relative;
}

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

.section-subtitle {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-line {
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 0 auto;
    border-radius: 2px;
}

/* =============== About Section =============== */
.about-content {
    display: grid;
    gap: 3rem;
}

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

.info-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow-color);
    border-color: var(--primary-color);
}

.info-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

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

.about-text {
    max-width: 800px;
    margin: 0 auto;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.feature-item:hover {
    background: var(--bg-secondary);
    transform: translateX(5px);
}

.feature-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.about-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    background: var(--gradient-primary);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hobbies-section {
    margin-top: 3rem;
}

.subsection-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.hobbies-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.hobby-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 50px;
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.hobby-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.hobby-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* =============== Skills Section =============== */
.skills {
    background: var(--bg-secondary);
}

.skill-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

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

.skill-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.skill-card:hover::before {
    transform: translateX(0);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.skill-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-level {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.level-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    width: 0;
    transition: width 1s ease;
}

.skill-card:hover .level-bar {
    width: var(--level);
}

.skill-percentage {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
}

/* =============== Experience Timeline =============== */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

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

.timeline-item {
    position: relative;
    width: 50%;
    padding: 2rem;
    animation: fadeInUp 1s ease;
}

.timeline-item.left {
    left: 0;
    text-align: right;
    padding-right: 3rem;
}

.timeline-item.right {
    left: 50%;
    padding-left: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 2rem;
    width: 20px;
    height: 20px;
    background: var(--bg-primary);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    z-index: 1;
}

.timeline-item.left::before {
    right: -10px;
}

.timeline-item.right::before {
    left: -10px;
}

.timeline-date {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all var(--transition-normal);
}

.timeline-content:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.timeline-item.right .timeline-tags {
    justify-content: flex-start;
}

.timeline-tags span {
    padding: 0.3rem 0.8rem;
    background: var(--bg-tertiary);
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Timeline Tablet - Simple Vertical Stack */
@media (max-width: 1024px) {
    .timeline {
        padding: 1rem 0;
    }

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

    .timeline-item {
        width: 100% !important;
        left: 0 !important;
        padding-left: 60px !important;
        padding-right: 1rem !important;
        padding-top: 1rem;
        padding-bottom: 1rem;
        text-align: left !important;
    }

    .timeline-item.left,
    .timeline-item.right {
        width: 100% !important;
        left: 0 !important;
        padding-left: 60px !important;
        padding-right: 1rem !important;
        text-align: left !important;
    }

    .timeline-item::before {
        left: 11px !important;
        right: auto !important;
    }

    .timeline-date {
        display: inline-block;
    }

    .timeline-tags {
        justify-content: flex-start !important;
    }
}

/* Timeline Mobile - Further Adjustments */
@media (max-width: 768px) {
    .timeline {
        padding: 0.5rem 0;
    }

    .timeline-item {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .timeline-date {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .timeline-content h3 {
        font-size: 1.1rem;
    }

    .timeline-content h4 {
        font-size: 0.95rem;
    }

    .timeline-content p {
        font-size: 0.9rem;
    }
}

/* =============== Projects Section =============== */
.projects {
    background: var(--bg-secondary);
}

.project-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-card {
    background: var(--bg-primary);
    border-radius: 15px;
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 10px 30px var(--shadow-color);
}

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

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

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

.project-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.project-link:hover {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

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

.tag {
    padding: 0.3rem 0.8rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

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

.project-tech {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 1.5rem;
}

.projects-more {
    text-align: center;
}

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

.achievement-card {
    background: var(--gradient-primary);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    color: white;
    transition: all var(--transition-normal);
}

.achievement-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.achievement-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.achievement-card p {
    opacity: 0.95;
    line-height: 1.6;
}

/* =============== Contact Section =============== */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

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

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

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-item i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: 10px;
    font-size: 1.2rem;
}

.contact-item h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.contact-item a,
.contact-item span {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.contact-item a:hover {
    color: var(--primary-color);
}

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

.social-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.3rem;
    transition: all var(--transition-normal);
    border: 2px solid var(--border-color);
}

.social-icon:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-5px);
}

.contact-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.form-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--text-light);
    pointer-events: none;
    transition: all var(--transition-fast);
}

.form-group input:focus ~ label,
.form-group input:valid ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:valid ~ label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    background: var(--bg-primary);
    padding: 0 5px;
    color: var(--primary-color);
}

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

/* Contact Section Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .contact-content {
        gap: 3rem;
    }

    .contact-info h3 {
        font-size: 1.6rem;
    }
}

/* Contact Section Mobile */
@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .contact-items {
        gap: 1.25rem;
    }

    .contact-item i {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .social-links {
        justify-content: center;
    }
}

/* =============== Footer =============== */
.footer {
    background: var(--bg-tertiary);
    padding: 2rem 0;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: inline-block;
    margin-bottom: 1rem;
}

/* Footer Social Links - Mobile Only */
.footer-social-links {
    display: none; /* Hidden by default on desktop/tablet */
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.footer-social-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all var(--transition-normal);
    border: 2px solid var(--border-color);
}

.footer-social-icon:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
}

/* Show footer social links only on mobile */
@media (max-width: 767px) {
    .footer-social-links {
        display: flex;
    }
}

.footer-text {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-quote {
    color: var(--text-light);
    font-style: italic;
}

/* =============== Back to Top Button =============== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

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

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* =============== Modal =============== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 15px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 1;
}

.modal-close:hover {
    background: var(--gradient-primary);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 3rem;
}

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

/* =============== Responsive Design =============== */

/* Tablet and Small Desktop: 768px - 1024px */
@media (max-width: 1024px) {
    /* Container */
    .container {
        padding: 0 1.5rem;
    }

    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        padding: 0 1.5rem;
    }

    .hero-image {
        margin-top: 2rem;
        order: 2;
    }

    .hero-text {
        order: 1;
    }

    .image-wrapper {
        width: 300px;
        height: 300px;
        margin: 0 auto;
    }

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

    .hero-name {
        font-size: 3rem;
    }

    /* About Section */
    .about-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .about-stats {
        gap: 1.5rem;
    }

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

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

    /* Sections */
    section {
        padding: 60px 0;
    }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
    /* Typography */
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 0.8rem;
    }

    .hero-name {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-greeting {
        font-size: 1rem;
    }

    .hero-roles {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    /* Sections */
    section {
        padding: 50px 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    /* Container */
    .container {
        padding: 0 1.25rem;
    }

    /* Navigation */
    .nav-container {
        padding: 1rem 1.25rem;
    }

    /* Hero Section */
    .hero-content {
        gap: 2rem;
        padding: 0 1.25rem;
    }

    .image-wrapper {
        width: 250px;
        height: 250px;
    }

    .status-badge {
        bottom: 20px;
        right: 20px;
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .hero-scroll {
        display: none;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

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

    /* About Section */
    .about-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-features {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .about-stats {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .about-description {
        font-size: 1rem;
        text-align: left;
    }

    /* Skills Section */
    .skill-categories {
        gap: 0.75rem;
    }

    .category-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

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

    .skill-card {
        padding: 1.25rem;
    }

    .skill-icon {
        font-size: 2.5rem;
    }

    /* Projects Section */
    .project-filters {
        gap: 0.75rem;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-image {
        height: 200px;
    }

    /* Achievements Section */
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Hobbies */
    .hobbies-grid {
        gap: 0.75rem;
    }

    .hobby-card {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .hobby-card i {
        font-size: 1.25rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0;
    }

    .footer-text,
    .footer-quote {
        font-size: 0.9rem;
    }

    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1rem;
    }

    /* Modal */
    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }

    .modal-body {
        padding: 2rem 1.5rem;
    }
}

/* Small Mobile: < 480px */
@media (max-width: 480px) {
    /* Typography */
    .hero-name {
        font-size: 2rem;
    }

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

    .hero-roles {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Navigation */
    .nav-container {
        padding: 0.875rem 1rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    /* Hero Section */
    .hero-content {
        padding: 0 1rem;
    }

    .image-wrapper {
        width: 220px;
        height: 220px;
    }

    .status-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
        bottom: 15px;
        right: 15px;
    }

    /* Buttons */
    .btn {
        padding: 0.7rem 1.25rem;
        font-size: 0.9rem;
    }

    /* About Section */
    .info-card {
        padding: 1.5rem;
    }

    .info-card i {
        font-size: 2rem;
    }

    .info-card h3 {
        font-size: 1.1rem;
    }

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

    .skill-card {
        padding: 1rem;
    }

    .skill-icon {
        font-size: 2rem;
    }

    .skill-card h3 {
        font-size: 0.9rem;
    }

    /* Projects Section */
    .project-content {
        padding: 1.25rem;
    }

    .project-title {
        font-size: 1.15rem;
    }

    .project-description {
        font-size: 0.9rem;
    }

    .project-tech {
        font-size: 1.25rem;
    }

    /* Contact Section */
    .contact-info h3 {
        font-size: 1.5rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    /* Achievements */
    .achievement-card {
        padding: 1.5rem;
    }

    .achievement-icon {
        font-size: 2.5rem;
    }

    .achievement-card h3 {
        font-size: 1.15rem;
    }

    .achievement-card p {
        font-size: 0.9rem;
    }

    /* Hobbies */
    .hobby-card {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .hobby-card i {
        font-size: 1.1rem;
    }
}

/* Extra Small Mobile: < 360px */
@media (max-width: 360px) {
    /* Further reduce font sizes for very small screens */
    .hero-name {
        font-size: 1.75rem;
    }

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

    .hero-description {
        font-size: 0.9rem;
    }

    /* Adjust image size */
    .image-wrapper {
        width: 200px;
        height: 200px;
    }

    /* Smaller buttons */
    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    /* Adjust card padding */
    .info-card,
    .achievement-card,
    .timeline-content {
        padding: 1.25rem;
    }

    /* Timeline adjustments for very small screens */
    .timeline-item {
        padding-left: 50px !important;
    }

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

    .timeline-item::before {
        left: 6px !important;
    }

    .timeline-date {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }

    /* Smaller skills grid */
    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.75rem;
    }

    .skill-card {
        padding: 0.75rem;
    }

    .skill-icon {
        font-size: 1.75rem;
    }

    /* Filter and category buttons */
    .category-btn,
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 50px;
    }

    .hero-scroll {
        display: none;
    }

    section {
        padding: 40px 0;
    }
}

/* =============== Utility Classes =============== */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* =============== Print Styles =============== */
@media print {
    .navbar, .side-nav, .social-sidebar, .back-to-top {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
}
