/**
 * Portfolio Styles - Optimized Version
 * Organized by sections for better maintainability
 */

/* =============================================================================
   CSS Variables & Theme Configuration
   ============================================================================= */
:root {
    /* Colors - Light Theme */
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --bg-primary: #f9fafb;
    --bg-secondary: #f3f4f6;
    --card-bg: #f5f6fa;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --hamburger-color: #111827;
    --social-bg: #b3b3b3;
    --cv-hover-bg: #eef2ff;
    --cv-hover-text: #4338ca;
    color-scheme: light;
}

.dark {
    /* Colors - Dark Theme */
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --card-bg: #1f2937;
    --nav-bg: rgba(17, 24, 39, 0.8);
    --hamburger-color: #fff;
    --social-bg: #959595;
    --cv-hover-bg: #232946;
    --cv-hover-text: #a5b4fc;
    color-scheme: dark;
}

/* =============================================================================
   Base Styles
   ============================================================================= */
body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
    color-scheme: light;
}

body.dark {
    color-scheme: dark;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
}

main {
    margin-top: 2rem;
}

/* =============================================================================
   Theme Utility Classes
   ============================================================================= */
.theme-bg {
    background-color: var(--bg-primary) !important;
}

.theme-text, 
.theme-heading {
    color: var(--text-primary) !important;
}

.theme-subheading {
    color: var(--primary) !important;
}

.theme-meta, 
.theme-desc {
    color: var(--text-secondary) !important;
}

.theme-card-bg {
    background-color: var(--card-bg) !important;
}

.theme-chip {
    background-color: #e0e7ff !important;
    color: #3730a3 !important;
    border-radius: 9999px;
    font-weight: 500;
}

/* =============================================================================
   Animations
   ============================================================================= */
.transition-all {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in {
    animation: fadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.slide-up {
    animation: slideUp 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* =============================================================================
   Buttons & Interactive Elements
   ============================================================================= */
.download-cv-btn {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-cv-btn:hover {
    background-color: var(--cv-hover-bg) !important;
    color: var(--cv-hover-text) !important;
    border-color: var(--cv-hover-text) !important;
    transform: scale(1.05);
}

#load-more-projects,
.collapse-btn {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #4f46e5;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

#load-more-projects:hover,
.collapse-btn:hover {
    background-color: #4338ca;
    color: #fff;
    transform: scale(1.05);
}

/* =============================================================================
   Social Links
   ============================================================================= */
.social-bg {
    background-color: var(--social-bg) !important;
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon {
    color: #111827 !important;
    transition: color 0.3s ease;
}

.dark .social-icon {
    color: #fff !important;
}

.social-icon-img {
    filter: none;
    transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .social-icon-img {
    filter: invert(1) brightness(2);
}

.social-bg:hover,
.social-bg:focus {
    background-color: var(--primary) !important;
}

.social-bg:hover .social-icon,
.social-bg:focus .social-icon {
    color: #fff !important;
}

.dark .social-bg:hover .social-icon,
.dark .social-bg:focus .social-icon {
    color: #111827 !important;
}

.social-bg:hover .social-icon-img,
.social-bg:focus .social-icon-img {
    filter: brightness(0) invert(1) !important;
}

.dark .social-bg:hover .social-icon-img,
.dark .social-bg:focus .social-icon-img {
    filter: brightness(0) invert(0) !important;
}

/* =============================================================================
   Skills Section
   ============================================================================= */
#skills-logos {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    box-sizing: border-box;
}

.skill-box {
    width: 72px;
    height: 64px;
    min-width: 0;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-box:hover {
    transform: scale(1.08);
}

/* =============================================================================
   Timeline (Experience & Education)
   ============================================================================= */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #cbd5e1;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
    z-index: 1;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #4f46e5;
    border-radius: 50%;
    top: 15px;
    z-index: 2;
}

.timeline-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.left::after {
    right: -10px;
}

.right::after {
    left: -10px;
}

/* =============================================================================
   Projects Section
   ============================================================================= */
.project-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary);
}

/* =============================================================================
   Footer
   ============================================================================= */
footer {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 4rem 2rem;
    text-align: center;
}

/* =============================================================================
   Responsive Design
   ============================================================================= */
@media screen and (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        text-align: right;
    }
    
    .timeline-item::after,
    .left::after,
    .right::after {
        left: 21px;
    }
    
    .right {
        left: 0;
    }
}