/* ==========================================================================
   RESPONSIVE.CSS - Mobile & Tablet Responsive Media Queries
   ========================================================================== */

/* Universal Mobile Overflow & Layout Protection */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
}

section, header, footer, .hero, .about-container, .skills-filter-wrap,
.unified-skills-grid, .projects-grid, .freelance-grid, .cert-grid,
.timeline-cyber, .contact-container, .compact-map-card {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ==========================================
   TABLET RESPONSIVE STYLES (max-width: 1024px)
   ========================================== */
@media (max-width: 1024px) {
    section {
        padding: 4rem 5%;
    }

    .projects-grid,
    .freelance-grid {
        grid-template-columns: repeat(2, minmax(260px, 300px));
        max-width: 640px;
        gap: 1.1rem;
    }

    .unified-skills-grid.icon-only-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
        gap: 1rem;
    }
}

/* ==========================================
   INTERMEDIATE BREAKPOINT (max-width: 850px)
   ========================================== */
@media (max-width: 850px) {
    .about-split-container {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }

    /* Responsive Cyber Timeline */
    .timeline-line {
        left: 20px;
        transform: none;
    }
    .timeline-item {
        width: 100%;
        padding-left: 52px !important;
        padding-right: 0 !important;
        left: 0 !important;
    }
    .timeline-item.left, .timeline-item.right {
        left: 0;
    }
    .timeline-item.left .timeline-node, .timeline-item.right .timeline-node {
        left: 2px !important;
        right: auto !important;
    }
    .timeline-item::after {
        left: 20px !important;
        right: auto !important;
        width: 32px;
    }
}

/* ==========================================
   MOBILE LANDSCAPE & TABLETS (max-width: 768px)
   ========================================== */
@media (max-width: 768px) {
    header { 
        padding: 0.75rem 4%; 
        width: 100%;
        box-sizing: border-box;
    }

    .cmd-palette-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.76rem;
    }

    nav ul {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(10, 12, 26, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        padding: 2rem 1rem;
        gap: 1.2rem;
        transform: translateY(-150%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        border-bottom: 1px solid rgba(0, 247, 255, 0.3);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 999;
    }
    nav ul.active { transform: translateY(0); }
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

    /* Hero Section */
    .hero {
        padding: 4.5rem 4% 2.5rem 4%;
        min-height: auto;
    }
    .hero-content { 
        flex-direction: column-reverse; 
        gap: 1.8rem; 
        text-align: center;
    }
    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .typewriter-container {
        justify-content: center;
    }
    .hero-text p {
        justify-content: center;
        text-align: center;
    }
    .cta-buttons {
        justify-content: center;
        width: 100%;
        gap: 0.75rem;
    }

    /* Profile Photo and Floating Badges */
    .profile-photo { 
        flex: 0 0 270px; 
        width: 270px;
        height: 270px;
        margin: 0.5rem auto 1rem auto;
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .profile-img { 
        width: 165px; 
        height: 165px; 
        border-width: 3.5px;
    }
    .floating-badge {
        font-size: 0.72rem;
        padding: 0.26rem 0.6rem;
        border-radius: 18px;
        gap: 0.35rem;
    }
    .floating-badge i {
        font-size: 0.82rem;
    }
    .badge-top-left { top: 6px; left: 4px; }
    .badge-top-right { top: 6px; right: 4px; }
    .badge-bottom-left { bottom: 6px; left: 4px; }
    .badge-bottom-right { bottom: 6px; right: 4px; }

    /* About Section */
    .about-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .coding-profile-grid {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Skills Grid */
    .skills-filter-wrap {
        gap: 0.45rem;
        margin-bottom: 1.4rem;
    }
    .skill-filter-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.78rem;
    }
    .unified-skills-grid.icon-only-grid {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        gap: 0.85rem;
    }

    /* Projects & Freelance Grid */
    .projects-grid,
    .freelance-grid {
        grid-template-columns: minmax(260px, 300px);
        max-width: 300px;
        margin: 0 auto;
        gap: 1.1rem;
    }
    .project-card,
    .freelance-card {
        width: 100%;
        max-width: 300px;
        height: 305px;
        border-radius: 14px;
    }
    .project-img,
    .freelance-banner {
        height: 120px;
    }
    .project-info,
    .freelance-info {
        padding: 0.75rem 0.85rem 0.8rem 0.85rem;
        height: calc(305px - 120px);
    }
    .project-info h3,
    .freelance-info h3 {
        font-size: 0.94rem;
    }

    /* Certifications Carousel */
    .cert-carousel-wrapper {
        gap: 0.35rem;
        max-width: 100%;
    }
    .cert-viewport {
        border-radius: 12px;
    }
    .cert-img-container {
        height: 210px;
    }
    .cert-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    .cert-slide-title {
        font-size: 1.05rem;
    }
    .cert-meta-info {
        padding: 0.95rem 1.1rem;
    }
    .cert-grid {
        grid-template-columns: 1fr;
        max-width: 440px;
        margin: 1.4rem auto 0 auto;
        gap: 1.15rem;
    }

    /* Contact Section */
    .contact-container { 
        grid-template-columns: 1fr; 
        gap: 1.8rem; 
    }
    .contact-form {
        padding: 1.5rem 1.2rem;
        border-radius: 14px;
    }
}

/* ==========================================
   MOBILE PHONES & NARROW SCREENS (max-width: 480px)
   ========================================== */
@media (max-width: 480px) {
    section { 
        padding: 3rem 4%; 
    }
    .section-title {
        font-size: 1.85rem;
        margin-bottom: 2rem;
    }

    .hero { 
        padding: 4.2rem 4% 2rem 4%; 
    }
    .btn { 
        width: 100%; 
        min-height: 42px;
        font-size: 0.88rem;
    }

    .profile-photo { 
        flex: 0 0 240px; 
        width: 240px;
        height: 240px;
        margin: 0.4rem auto 0.8rem auto;
    }
    .profile-img { 
        width: 145px; 
        height: 145px; 
    }
    .floating-badge {
        font-size: 0.68rem;
        padding: 0.22rem 0.52rem;
    }
    .badge-top-left { top: 4px; left: 2px; }
    .badge-top-right { top: 4px; right: 2px; }
    .badge-bottom-left { bottom: 4px; left: 2px; }
    .badge-bottom-right { bottom: 4px; right: 2px; }

    .about-metrics-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 0.6rem;
    }
    .metric-chip {
        padding: 0.55rem 0.7rem;
        border-radius: 10px;
    }
    .metric-val {
        font-size: 0.95rem;
    }
    .metric-lbl {
        font-size: 0.68rem;
    }

    .coding-profile-grid { 
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.85rem;
    }
    .coding-profile-card a {
        font-size: 0.8rem;
    }

    /* Skills Grid on Mobile Phones */
    .unified-skills-grid.icon-only-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 1.1rem 0.5rem;
    }
    .skill-icon-card {
        padding: 0.4rem 0.1rem !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    .skill-icon-box {
        font-size: 2.2rem !important;
        min-height: 38px;
    }
    .skill-icon-box svg,
    .skill-icon-box img,
    .skill-icon-box .skill-brand-img {
        width: 32px;
        height: 32px;
    }
    .skill-name-label {
        font-size: 0.74rem;
    }

    /* Projects & Freelance Grid on Mobile Phones */
    .projects-grid,
    .freelance-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 1.15rem;
    }
    .project-card,
    .freelance-card {
        width: 100%;
        height: auto;
        min-height: 330px;
        border-radius: 14px;
    }
    .project-img,
    .freelance-banner {
        height: 145px;
    }
    .project-info,
    .freelance-info {
        padding: 0.85rem 0.95rem;
        gap: 0.28rem;
    }
    .project-info h3,
    .freelance-info h3 {
        font-size: 0.98rem;
    }
    .project-info p,
    .freelance-info p {
        font-size: 0.76rem;
        line-height: 1.35;
        margin-bottom: 0.4rem;
    }
    .btn-repo-pill,
    .btn-live-pill,
    .btn-golden-pill {
        padding: 0.45rem 0.8rem;
        font-size: 0.74rem;
        min-height: 30px;
    }

    /* Certifications on Mobile Phones */
    .cert-carousel-wrapper {
        gap: 0.25rem;
    }
    .cert-img-container {
        height: 185px;
    }
    .cert-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .cert-slide-title {
        font-size: 0.92rem;
    }
    .cert-slide-issuer {
        font-size: 0.78rem;
    }
    .cert-meta-info {
        padding: 0.85rem 0.95rem;
    }

    .cert-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 1rem;
    }
    .cert-card {
        padding: 1rem;
        border-radius: 12px;
    }

    /* Timeline Badges on Mobile */
    .hub-company-branding {
        gap: 0.55rem;
    }
    .company-logo-badge {
        height: 34px;
        min-width: 34px;
        padding: 3px 6px;
    }
    .company-logo-badge.brand-whitestone {
        min-width: 75px;
    }
    .company-logo-badge.brand-stackqueue {
        min-width: 85px;
    }
    .company-logo-badge.brand-kiot,
    .company-logo-badge.brand-sreevari {
        width: 34px;
        height: 34px;
    }
    .hub-company-logo {
        max-height: 24px;
    }

    /* Telemetry Footer */
    .telemetry-bar-wrap {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    .telemetry-pill,
    .visitor-counter-pill,
    .sfx-toggle-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
    }

    /* Floating Action Buttons */
    .floating-whatsapp-btn {
        bottom: 1.2rem !important;
        right: 1.2rem !important;
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    .back-to-top-btn {
        bottom: 4.6rem !important;
        right: 1.2rem !important;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

