/* Muhammad Majid Ahmad Portfolio - Optimized Styles */

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
}

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Timeline Styles */
.timeline-item {
    border-left: 3px solid #667eea;
}

/* Skill Bar Styles */
.skill-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 2s ease;
    will-change: width;
    animation: fillSkill 2s ease-in-out;
}

@keyframes fillSkill {
    from {
        width: 0;
    }
}

/* Publication Styles */
.publication-item {
    border-left: 4px solid #10b981;
}

.research-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

/* Project Category Styles */
.project-category {
    margin-bottom: 2rem;
}

.category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-content {
    background: white;
    border-radius: 0 0 0.75rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-top: none;
}

.project-item {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.project-item:last-child {
    border-bottom: none;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

/* Performance Optimizations */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Mobile Menu Animations */
#mobile-menu {
    transition: max-height 0.3s ease-in-out;
    overflow: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Responsive Design */
@media (max-width: 1023px) {
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.25rem !important;
    }

    .hero-description {
        font-size: 1rem !important;
    }

    .hero-image {
        width: 250px !important;
        height: 250px !important;
    }

    .hero-image-inner {
        width: 220px !important;
        height: 220px !important;
    }

    .section-title {
        font-size: 2.5rem !important;
    }

    .section-subtitle {
        font-size: 1.125rem !important;
    }

    .mobile-menu-btn {
        padding: 8px;
        font-size: 1.25rem;
    }

    .nav-brand {
        font-size: 1.125rem !important;
    }

    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .skill-item {
        margin-bottom: 1.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr !important;
    }

    .profile-grid {
        grid-template-columns: 1fr !important;
    }

    .research-card,
    .card-hover {
        padding: 1.5rem !important;
    }

    .nav-brand {
        white-space: nowrap;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .nav-brand {
        font-size: 1.25rem !important;
    }

    .mobile-menu-btn {
        padding: 10px;
        font-size: 1.125rem;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem !important;
    }

    .section-title {
        font-size: 2rem !important;
    }

    .card-padding {
        padding: 1.5rem !important;
    }

    .timeline-item {
        padding-left: 1.5rem !important;
    }

    .hero-image {
        width: 200px !important;
        height: 200px !important;
    }

    .hero-image-inner {
        width: 180px !important;
        height: 180px !important;
    }

    .nav-brand {
        font-size: 1rem !important;
    }

    .section-subtitle {
        font-size: 1rem !important;
    }
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto !important;
    }
}

/* Enhanced Print Styles for PDF Generation */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        margin: 0;
        padding: 0;
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: white !important;
    }

    /* Navigation - Only on first page */
    nav {
        position: static !important;
        background: white !important;
        box-shadow: none !important;
        border-bottom: 2px solid #667eea !important;
        margin-bottom: 20px;
        page-break-after: avoid;
    }

    .max-w-7xl {
        max-width: none !important;
        padding: 0 20px !important;
    }

    /* Hide mobile menu and interactive elements */
    #mobile-menu-btn,
    #mobile-menu,
    .lg\\:hidden {
        display: none !important;
    }

    /* Hero section */
    #home {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        page-break-after: avoid;
        padding: 30px 0 !important;
    }

    .hero-title {
        font-size: 36pt !important;
        font-weight: bold !important;
        margin-bottom: 10px !important;
    }

    .hero-subtitle {
        font-size: 18pt !important;
        margin-bottom: 8px !important;
    }

    .hero-description {
        font-size: 14pt !important;
        margin-bottom: 20px !important;
    }

    /* Section titles */
    .section-title {
        font-size: 24pt !important;
        font-weight: bold !important;
        color: #1f2937 !important;
        margin-bottom: 15px !important;
        page-break-after: avoid;
    }

    .section-subtitle {
        font-size: 14pt !important;
        color: #6b7280 !important;
        margin-bottom: 20px !important;
    }

    /* Sections */
    section {
        page-break-inside: avoid;
        margin-bottom: 30px;
        padding: 20px 0;
    }

    section:not(#home) {
        background: white !important;
    }

    /* Research cards */
    .research-card {
        background: #f9fafb !important;
        border: 1px solid #e5e7eb !important;
        page-break-inside: avoid;
        margin-bottom: 15px;
        padding: 15px !important;
    }

    .research-card h3 {
        font-size: 14pt !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
        margin-bottom: 8px !important;
    }

    .research-card p {
        font-size: 11pt !important;
        color: #4b5563 !important;
        line-height: 1.4 !important;
    }

    /* Project categories */
    .project-category {
        page-break-inside: avoid;
        margin-bottom: 25px;
    }

    .category-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        padding: 12px 15px !important;
        font-size: 16pt !important;
        font-weight: 600 !important;
        page-break-after: avoid;
    }

    .category-content {
        background: white !important;
        border: 1px solid #e5e7eb !important;
    }

    .project-item {
        padding: 15px !important;
        border-bottom: 1px solid #f3f4f6 !important;
        page-break-inside: avoid;
    }

    .project-item h3 {
        font-size: 13pt !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
        margin-bottom: 8px !important;
    }

    .project-item p {
        font-size: 10pt !important;
        color: #4b5563 !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
    }

    .project-tags {
        margin-top: 8px !important;
    }

    .project-tag {
        font-size: 8pt !important;
        padding: 2px 6px !important;
        margin-right: 4px !important;
        margin-bottom: 2px !important;
        border: 1px solid #d1d5db !important;
        background: #f9fafb !important;
        color: #374151 !important;
    }

    /* Timeline items */
    .timeline-item {
        page-break-inside: avoid;
        margin-bottom: 15px;
        padding-left: 20px !important;
        border-left: 3px solid #667eea !important;
    }

    .timeline-item h3 {
        font-size: 13pt !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
    }

    .timeline-item p {
        font-size: 10pt !important;
        color: #4b5563 !important;
        line-height: 1.3 !important;
    }

    /* Skills */
    .skill-item {
        margin-bottom: 10px !important;
    }

    .skill-bar {
        height: 6px !important;
        background: #e5e7eb !important;
        border: 1px solid #d1d5db !important;
    }

    .skill-fill {
        background: linear-gradient(90deg, #667eea, #764ba2) !important;
    }

    /* Contact section */
    .contact-grid {
        display: block !important;
    }

    .contact-grid>div {
        margin-bottom: 15px !important;
    }

    /* Hide hover effects and transitions */
    .card-hover {
        transform: none !important;
        box-shadow: none !important;
        transition: none !important;
    }

    /* Ensure proper page breaks */
    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    /* Force page break before major sections if needed */
    #research,
    #publications,
    #education,
    #skills {
        page-break-before: auto;
    }

    /* Hide "Get In Touch" button in print */
    .hero-section a[href="#contact"] {
        display: none !important;
    }
}