/* ----------------------------------------------------
 * Responsive Layout Adaptations
 * Mahmoud Ibrahim Ahmed Mohamed - Data Analyst Portfolio
 * ---------------------------------------------------- */

/* --- Ultra-Wide Display Scaling --- */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1350px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .hero-image-frame {
        width: 520px;
        height: 645px;
    }
}

/* --- Large Laptop / Tablet Landscape (max-width: 1024px) --- */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    /* Hero split section adjustments */
    .hero-container {
        gap: 2.5rem;
    }
    
    .hero-image-frame {
        width: 380px;
        height: 470px;
    }

    /* About me grid */
    .about-grid {
        gap: 3rem;
    }

    /* Services grid layout */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Contact layout */
    .contact-layout {
        gap: 2.5rem;
    }
}

/* --- Small Tablet / Large Mobile (max-width: 768px) --- */
@media screen and (max-width: 768px) {
    /* Hide custom cursor on touch devices */
    #custom-cursor, #custom-cursor-dot {
        display: none !important;
    }
    
    * {
        cursor: auto !important; /* Restore normal cursor */
    }

    /* Floating Navbar mobile responsiveness */
    .navbar-container {
        top: 1rem;
        width: 95%;
    }

    .navbar {
        padding: 0.8rem 1.5rem;
        border-radius: 20px;
    }

    .mobile-toggle {
        display: flex;
        z-index: 999;
    }

    /* Navigation Links Overlay */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--surface-color);
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: var(--shadow-lg);
        z-index: 990;
    }

    .nav-links.open {
        right: 0;
    }

    /* Burger Menu Active Animations */
    .mobile-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Hero section stacked */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-content {
        align-items: center;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-image-area {
        order: -1; /* Display visual container first on mobile */
    }

    .hero-image-frame {
        width: 360px;
        height: 446px;
        margin: 0 auto;
    }

    /* About section grid stacked */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-image-container {
        max-width: 320px;
        margin: 0 auto;
    }

    .about-stats-panel {
        justify-content: space-around;
        gap: 1.5rem;
    }

    /* Education vertical timeline mobile adaptation */
    .timeline-line {
        left: 20px;
    }

    .timeline-dot {
        left: 20px;
    }

    .timeline-item {
        justify-content: flex-start;
        padding-left: 45px;
        margin-bottom: 2.5rem;
    }

    .timeline-content {
        width: 100%;
    }

    .timeline-item.left-align,
    .timeline-item.right-align {
        justify-content: flex-start;
    }

    /* Services Grid stacked */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Contact layout stacked */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-form-container {
        padding: 2rem;
    }

    /* Footer column direction */
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}

/* --- Small Mobile Devices (max-width: 480px) --- */
@media screen and (max-width: 480px) {
    .navbar {
        padding: 0.8rem 1rem;
    }

    .hero-image-frame {
        width: 280px;
        height: 347px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

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

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

    .about-stats-panel {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        text-align: center;
    }

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

    .contact-form-container {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }

    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 38px;
        height: 38px;
    }
}
