/* 
 * Responsive stylesheet for MAIN CONTENT (NON-HERO) - Didier Merk's academic resume website
 * Contains all responsive styles EXCEPT hero section
 * Preserves original desktop design, applies scaling only at breakpoints
 * Version: 3.0 - Compartmentalized main content responsive behavior
 */

/* ============================================
   NO DEFAULT CHANGES - Desktop design preserved
   All changes below are within media queries only
   ============================================ */

/* ============================================
   LARGE DEVICES (Desktops, less than 1200px)
   Main content styles only (non-hero)
   ============================================ */
@media (max-width: 1199.98px) {
    h2 {
        font-size: 2.2rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .circles-composition {
        position: relative;
        margin: 0 auto;
        transform: translateX(30px);
    }
}

/* Large Devices at 1080px */
@media (max-width: 1080px) {
    .circles-composition {
        position: relative;
        margin: 0 auto;
        transform: translateX(30px);
    }
}

/* ============================================
   MEDIUM DEVICES (Tablets, less than 992px)
   Main content styles only (non-hero)
   ============================================ */
@media (max-width: 991.98px) {
    .container {
        max-width: 1080px;
    }
    
    h2 {
        font-size: 2rem;
    }

    .about-cards {
        margin-top: 0;
    }
    
    .about-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-left {
        padding-right: 0;
    }
    
    .about-right {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-title {
        text-align: center;
    }
    
    .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ============================================
   SMALL DEVICES (Landscape Phones, less than 768px)
   Main content styles only (non-hero)
   ============================================ */
@media (max-width: 767.98px) {
    .container {
        max-width: 767px;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    /* Mobile Navigation */
    .nav-container {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-primary);
        width: 40px;
        height: 40px;
        cursor: pointer;
        z-index: 1000;
    }

    .nav-toggle.active .hamburger span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

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

    .nav-toggle.active .hamburger span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    .logo {
        justify-self: center;
        text-align: center;
    }
    
    .mobile-theme-toggle {
        display: flex;
        justify-self: end;
    }
    
    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        max-height: 0;
        background-color: var(--card-bg);
        overflow: hidden;
        flex-direction: column;
        align-items: center;
        transition: max-height 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
        z-index: 998;
        padding: 0;
        box-shadow: none;
        margin-top: -1px;
    }
    
    .nav-links.show {
        max-height: 300px;
        padding: 1rem 0;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    }
    
    .nav-links li {
        margin: 0.75rem 0;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .nav-links.show li {
        opacity: 1;
        transform: translateY(0);
    }
    
    .nav-links.show li:nth-child(1) { transition-delay: 0.05s; }
    .nav-links.show li:nth-child(2) { transition-delay: 0.1s; }
    .nav-links.show li:nth-child(3) { transition-delay: 0.15s; }
    .nav-links.show li:nth-child(4) { transition-delay: 0.2s; }
    .nav-links.show li:nth-child(5) { transition-delay: 0.25s; }
    
    .theme-toggle {
        display: none;
    }
    
    .about-right {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 10px;
    }
    
    .timeline-item {
        padding-left: 40px;
    }
    
    .timeline-dot {
        left: 3px;
    }
    
    .timeline-date {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .tabs-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-btn {
        flex: 1 1 auto;
        min-width: 45%;
    }
    
    .info-card {
        padding: 1.25rem;
    }
    
    .info-card h3 {
        font-size: 1.1rem;
    }
    
    .info-card p, .info-card ul {
        font-size: 0.95rem;
    }
    
    .publication-item {
        padding: 1.25rem;
    }
    
    .contact-form input,
    .contact-form textarea {
        font-size: 0.95rem;
    }
    
    /* .degree-detail-info, .degree-highlights {
        padding: 1.25rem;
    } */
    
    .degree-highlights h4 {
        font-size: 1.1rem;
    }

    /* Reduce skills arrow size on mobile */
    .skill-simple-content li::before {
        font-size: 0.95rem;
    }
}

/* ============================================
   EXTRA SMALL DEVICES (Portrait Phones, less than 576px)
   Main content styles only (non-hero)
   ============================================ */
@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }

    .project-card {
        flex: 0 0 calc(100vw - 2rem);
        max-width: 100%;
    }
    
    h2 {
        font-size: 1.6rem;
    }

    /* Tab button mobile sizing */
    .tab-btn {
        padding: 0.6rem 0.5rem;
        font-size: 0.95rem;
    }
    
    .tab-btn span {
        font-size: 0.9rem;
    }
    
    .tab-btn i {
        font-size: 1.1rem;
    }
    
    /* Back-to-top button mobile sizing and positioning */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
    }

    .skill-simple-content li::before {
        font-size: 0.85rem;
        top: 0rem;
    }
}

/* ============================================
   SAFARI BACKDROP FILTER FIX
   ============================================ */
@supports not (backdrop-filter: blur(10px)) {
    header {
        background-color: var(--primary);
    }
    
    .light-mode header {
        background-color: var(--background);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    header, 
    footer, 
    .back-to-top, 
    .scroll-indicator {
        display: none;
    }
    
    body {
        background-color: #fff;
        color: #000;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* ============================================
   EXTRA SMALL DEVICES (under 450px)
   Simplified footer with icons only
   ============================================ */
@media (max-width: 449.98px) {
    /* Hide all text content in footer links */
    .footer-links a {
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        transition: var(--transition);
    }
    
    /* Make icons visible and properly sized */
    .footer-links a i {
        font-size: 1.2rem;
        color: var(--secondary);
    }
    
    /* Ensure icons stay visible */
    .footer-links a i::before {
        font-size: 1.2rem;
    }
    
    /* Adjust footer-links layout */
    .footer-links {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    /* Make copyright text smaller but keep it visible */
    footer p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    /* Optional: Add hover effect for better UX */
    .footer-links a:hover {
        background-color: rgba(100, 255, 218, 0.1);
    }
    
    /* Reduce footer padding on very narrow screens */
    footer {
        padding: 1.5rem 0;
    }
}