/* ==========================================================================
   MOBILE VIEW CONTROLLER - ULTIMATE (ALL SECTIONS POLISHED)
   Built from scratch for a top-tier mobile experience.
   Focus: Unified Layout, Edge-to-Edge Design, Modern Typography.
   ========================================================================== */

@media (max-width: 768px) {

    /* ===================================
       1. GLOBAL RESET & TYPOGRAPHY
       =================================== */
    body {
        overflow-x: hidden;
    }

    section {
        padding: 4rem 1rem !important;
        /* Consistent vertical spacing */
    }

    /* Modernize Headings */
    h2,
    .section-title,
    .projects-main-title,
    .skills-main-title {
        font-size: 2.2rem !important;
        text-align: center !important;
        margin-bottom: 2rem !important;
    }

    p,
    .section-description,
    .projects-subtitle-text,
    .skills-subtitle-text {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        text-align: center !important;
    }

    /* ===================================
       2. HERO SECTION (PREMIUM)
       =================================== */
    .hero-section-custom {
        padding: 6rem 1rem 4rem !important;
        min-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        animation: gradientFloatDark 25s ease-in-out infinite !important;
    }

    .hero-img-custom {
        width: 150px !important;
        height: 150px !important;
        margin: 0 auto 1.5rem auto !important;
        border: 3px solid rgba(0, 229, 255, 0.5) !important;
    }

    .hero-name {
        font-size: 3rem !important;
        line-height: 1.1 !important;
        margin-bottom: 0.5rem !important;
    }

    .hero-role {
        font-size: 1.2rem !important;
        opacity: 0.9 !important;
        margin-bottom: 1rem !important;
    }

    .scroll-down-arrow {
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: 2rem !important;
    }

    /* ===================================
       3. ABOUT SECTION (UNIFIED & SEAMLESS)
       =================================== */
    .about-card {
        background: rgba(20, 27, 46, 0.7) !important;
        backdrop-filter: blur(12px) !important;
        border: 1px solid rgba(0, 229, 255, 0.15) !important;
        border-radius: 20px !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .about-header {
        background: linear-gradient(180deg, rgba(0, 229, 255, 0.05) 0%, transparent 100%) !important;
        padding: 2.5rem 1.5rem 1rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        margin-bottom: 0 !important;
    }

    .about-avatar {
        width: 100px !important;
        height: 100px !important;
        border-radius: 50% !important;
        margin-bottom: 1rem !important;
        border: 2px solid #00E5FF !important;
    }

    .about-description {
        padding: 2rem 1.5rem !important;
        text-align: center !important;
        font-size: 1.05rem !important;
        line-height: 1.8 !important;
        color: #E0E0E0 !important;
        background: transparent !important;
    }

    .about-stats {
        display: flex !important;
        justify-content: center !important;
        gap: 1rem !important;
        padding-bottom: 2rem !important;
    }

    /* ===================================
       4. EDUCATION SECTION (CLEAN TIMELINE)
       =================================== */
    .education-section-redesign {
        background: transparent !important;
        padding: 3rem 0 !important;
        margin: 0 !important;
        width: 100% !important;

        margin-left: -1rem !important;
        margin-right: -1rem !important;
        width: calc(100% + 2rem) !important;
    }

    .education-section-redesign .container {
        padding: 0 1rem !important;
        width: 100% !important;
    }

    .education-content-card {
        background: rgba(10, 14, 39, 0.8) !important;
        border: 1px solid rgba(0, 229, 255, 0.2) !important;
        border-radius: 16px !important;
        padding: 2rem 1.5rem !important;
        margin-bottom: 1.5rem !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    }

    .education-header-wrapper {
        text-align: center !important;
        margin-bottom: 2rem !important;
    }

    /* ===================================
       5. SKILLS SECTION (2-COL GRID)
       =================================== */
    .skills-section-modern .container {
        padding: 0 !important;
    }

    .skills-grid-modern {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        padding: 0 0.5rem !important;
    }

    .skill-card-modern {
        margin: 0 !important;
        padding: 1.5rem 1rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        height: 100% !important;
    }

    .skill-icon {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }

    .skill-name {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }

    .skill-level {
        font-size: 0.8rem !important;
    }

    .skills-filters {
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 1rem !important;
        display: flex !important;
        gap: 0.5rem !important;
        justify-content: flex-start !important;
    }

    /* ===================================
       6. PROJECTS SECTION (FULL WIDTH IMPACT)
       =================================== */
    .projects-section-modern {
        padding: 3rem 0 !important;
    }

    .projects-section-modern .container {
        padding: 0 1rem !important;
        width: 100% !important;
        max-width: none !important;
    }

    .featured-projects-hero {
        margin-top: 2rem !important;
    }

    .project-hero-card {
        margin-bottom: 2rem !important;
        border-radius: 16px !important;
        overflow: hidden !important;
        background: rgba(10, 14, 39, 0.6) !important;
    }

    .project-hero-image img {
        height: 200px !important;
        object-fit: cover !important;
    }

    .project-hero-content {
        padding: 2rem 1.5rem !important;
    }

    .project-card {
        width: 100% !important;
        margin: 0 0 2rem 0 !important;
        max-width: none !important;
    }

    .project-image img {
        height: 180px !important;
    }

    /* ===================================
       7. CONTACT SECTION (WIDENED & TALLER)
       =================================== */
    .contact-section-modern {
        padding: 3rem 0 !important;
        /* Edge to Edge */
    }

    .contact-container {
        padding: 0 1rem !important;
        /* Reset nested padding */
        width: 100% !important;
        max-width: none !important;
    }

    .contact-form-card,
    .contact-content {
        padding: 2.5rem 1.5rem !important;
        border-radius: 16px !important;
        background: rgba(15, 20, 45, 0.8) !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Make inputs taller and easier to tap */
    .form-control {
        min-height: 55px !important;
        font-size: 1rem !important;
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }

    .form-label {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
        color: var(--accent-cyan) !important;
    }

    .contact-btn {
        width: 100% !important;
        padding: 1.2rem !important;
        font-size: 1.1rem !important;
        margin-top: 1rem !important;
    }

    /* ===================================
       8. RESUME & UTILS
       =================================== */
    .resume-section-modern {
        padding: 3rem 1rem !important;
    }

    .resume-download-card {
        padding: 2rem !important;
        gap: 1.5rem !important;
    }

    .resume-icon-wrapper,
    .resume-stats-grid {
        display: none !important;
    }

    .desktop-only {
        display: none !important;
    }
}

/* END MOBILE QUERY */

/* ==========================================================================
   TABLET / IPAD VIEW CONTROLLER (769px - 1024px)
   "The Hybrid View" - Combines mobile cleanliness with desktop grids.
   ========================================================================== */

@media screen and (min-width: 769px) and (max-width: 1024px) {

    /* GLOBAL: Increase breathing room */
    section {
        padding: 5rem 2rem !important;
    }

    .container {
        max-width: 90% !important;
    }

    /* 1. HERO: Balanced for Tablet */
    .hero-section-custom {
        min-height: 60vh !important;
        /* Not full screen on tall tablets */
        padding-top: 8rem !important;
    }

    .hero-name {
        font-size: 3.5rem !important;
    }

    .hero-role {
        font-size: 1.5rem !important;
    }

    /* 2. ABOUT: Centered & Contained (Don't stretch full width) */
    .about-card {
        margin: 0 auto !important;
        width: 85% !important;
        /* Prevent looking too wide */
        background: rgba(20, 27, 46, 0.7) !important;
        backdrop-filter: blur(12px) !important;
        border-radius: 24px !important;
    }

    .about-stats {
        gap: 2rem !important;
    }

    /* 3. SKILLS: 4 Columns (Mini Desktop) */
    .skills-grid-modern {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        /* 4 per row */
        gap: 1.5rem !important;
    }

    .skill-card-modern {
        padding: 2rem 1rem !important;
    }

    /* 4. PROJECTS: 2 Columns (Side by Side) */
    .projects-section-modern .container {
        max-width: 95% !important;
    }

    /* Add a grid wrapper for projects on Tablet if not present, 
       or assume standard grid behavior */
    .project-cards-grid,
    .hero-cards-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }

    /* Ensure Hero cards fit in the grid */
    .project-hero-card {
        margin-bottom: 0 !important;
        /* Gap handles it */
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .project-hero-content {
        flex-grow: 1 !important;
    }

    /* 5. EDUCATION: Unboxed but contained */
    .education-section-redesign {
        width: 90% !important;
        margin: 0 auto !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .education-content-card {
        margin-bottom: 2rem !important;
    }

    /* 6. CONTACT: Contained */
    .contact-form-card {
        width: 80% !important;
        margin: 0 auto !important;
    }
}