/* ===========================================
   DATAILEDVIEW TOOLS — responsive.css
   Mobile-first responsive overrides
   Breakpoints: 1280 | 1024 | 768 | 480 | 360
=========================================== */

/* =========================================
   LARGE DESKTOP TRIM — 1280px
========================================= */
@media (max-width: 1280px) {

    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1.8fr 1fr 1fr 1fr 1.2fr;
        gap: 28px;
    }
}

/* =========================================
   COMPACT NAVIGATION — 1150px
========================================= */
@media (max-width: 1150px) {
    .navbar-nav { display: none; }
    .navbar-mobile-toggle { display: flex; }
}

@media (max-width: 360px) {
    .navbar-inner .navbar-badge { display: none; }
    .navbar-inner .navbar-actions { gap: 4px; }
}

/* =========================================
   TABLET — 1024px
========================================= */
@media (max-width: 1024px) {

    /* --- Navbar --- */
    .navbar-nav {
        gap: 2px;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }

    /* --- Hero --- */
    .hero {
        padding: 64px 0 60px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 48px;
        text-align: center;
    }

    .hero-left {
        align-items: center;
        order: 2;
    }

    .hero-right {
        order: 1;
    }

    .hero-title,
    .hero-subtitle {
        max-width: 100%;
    }

    .hero-search {
        max-width: 520px;
    }

    .hero-popular {
        justify-content: center;
    }

    /* Reposition floating icons for centered layout */
    .hero-float-icon.fi-1 { top: -8%;  left: 4%;  }
    .hero-float-icon.fi-2 { top: 10%;  left: 0%; }
    .hero-float-icon.fi-3 { top: 38%;  left: 4%; }
    .hero-float-icon.fi-4 { bottom: 10%; left: 0%;  top: auto; }
    .hero-float-icon.fi-5 { bottom: -4%; left: 4%;  top: auto; }

    /* --- Tools Layout --- */
    .tools-section-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* --- Why --- */
    .why-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* --- Footer --- */
    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-made {
        align-items: flex-start;
    }
}

/* =========================================
   MOBILE — 768px
========================================= */
@media (max-width: 768px) {

    /* --- Navbar --- */
    .navbar-inner {
        gap: 12px;
        height: 60px;
    }

    .navbar-nav {
        display: none;
    }

    .navbar-mobile-toggle {
        display: flex;
    }

    .navbar-brand-name {
        font-size: 16px;
    }

    .navbar-badge {
        font-size: 10px;
        padding: 1px 7px;
    }

    /* --- Hero --- */
    .hero {
        padding: 48px 0 52px;
    }

    .hero-inner {
        gap: 36px;
    }

    .hero-title {
        font-size: clamp(1.75rem, 7vw, 2.4rem);
    }

    .hero-subtitle {
        font-size: var(--font-sm);
        margin-top: -8px;
    }

    .hero-search {
        flex-direction: row;
        padding: 6px 6px 6px 14px;
        max-width: 100%;
        gap: 6px;
    }

    .hero-search input {
        font-size: 13px;
    }

    .hero-search .btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .hero-popular {
        gap: 8px;
    }

    .hero-popular-tag {
        font-size: 12px;
        padding: 4px 10px;
    }

    /* Floating icons — reduce size & keep contained */
    .hero-float-icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    /* Laptop mockup — scale down */
    .hero-laptop {
        max-width: 420px;
    }

    .laptop-code {
        font-size: 9px;
        line-height: 1.6;
        padding: 10px 12px;
    }

    .laptop-tab {
        font-size: 10px;
        padding: 3px 10px;
    }

    .laptop-toolbar-btn {
        font-size: 9px;
        padding: 2px 8px;
    }

    /* --- Categories --- */
    .categories {
        padding: 20px 0;
    }

    .categories-grid {
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
        padding-bottom: 4px;
        /* smooth momentum scroll on iOS */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        touch-action: pan-x;
    }

    .categories-grid::-webkit-scrollbar {
        display: none;
    }

    .category-item {
        min-width: 68px;
        flex: 0 0 auto;
        padding: 10px 8px;
        gap: 6px;
    }

    .category-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .category-item span {
        font-size: 11px;
    }

    /* --- Tools Section --- */
    .tools-section {
        padding: 44px 0;
    }

    .section-head {
        flex-wrap: wrap;
        gap: 8px;
    }

    .section-title {
        font-size: 17px;
    }

    /* --- Tools Grid --- */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tool-card {
        padding: 14px 14px 12px;
        gap: 6px;
    }

    .tool-card-icon {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .tool-card-name {
        font-size: 13px;
    }

    .tool-card-desc {
        font-size: 11.5px;
    }

    /* --- Trending Panel --- */
    .trending-panel {
        padding: 16px;
    }

    .trending-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .trending-name {
        font-size: 13px;
    }

    /* --- Why Section --- */
    .why-section {
        padding: 52px 0;
    }

    .why-header {
        margin-bottom: 28px;
    }

    .why-title {
        font-size: 24px;
    }

    .why-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin-top: 28px;
    }

    /* Last card spans full width when 5 items in 2-col */
    .why-card:last-child {
        grid-column: 1 / -1;
        max-width: 320px;
        margin: 0 auto;
        width: 100%;
    }

    .why-card {
        padding: 22px 16px;
    }

    .why-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
        margin-bottom: 12px;
    }

    .why-card-title {
        font-size: 15px;
    }

    .why-card-desc {
        font-size: 13px;
    }

    /* --- Newsletter --- */
    .newsletter-section {
        padding: 52px 0;
    }

    .newsletter-inner {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .newsletter-illustration {
        display: none;
    }

    .newsletter-content {
        align-items: center;
    }

    .newsletter-title {
        font-size: 22px;
    }

    .newsletter-desc {
        font-size: 13px;
    }

    .newsletter-form {
        flex-direction: row;
        width: 100%;
        max-width: 100%;
        gap: 8px;
    }

    .newsletter-form input {
        height: 44px;
        font-size: 13px;
    }

    .newsletter-form button {
        padding: 0 20px;
        height: 44px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* --- Footer --- */
    .footer {
        padding: 44px 0 0;
    }

    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 20px;
        padding-bottom: 32px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-brand-desc {
        max-width: 100%;
        font-size: 13px;
    }

    .footer-made {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 16px 0 20px;
    }

    .footer-bottom-links {
        flex-direction: row;
        gap: 16px;
        justify-content: center;
    }

    /* --- Mobile Nav Drawer width --- */
    .mobile-nav-panel {
        width: 260px;
    }
}

/* =========================================
   SMALL MOBILE — 480px
========================================= */
@media (max-width: 480px) {

    /* Tighter container edges */
    .container {
        width: min(100% - 28px, var(--container));
    }

    /* --- Navbar --- */
    .navbar-inner {
        gap: 8px;
    }

    /* Hide bookmark icon to save space */
    .nav-icon-btn:last-of-type:not([data-theme-toggle]):not([data-search-open]) {
        display: none;
    }

    /* --- Hero --- */
    .hero {
        padding: 40px 0 44px;
    }

    .hero-title {
        font-size: clamp(1.6rem, 8vw, 2rem);
    }

    .hero-badges {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 16px;
    }

    .hero-badges .separator {
        display: none;
    }

    /* Hero search — keep row layout, just tighter */
    .hero-search {
        padding: 5px 5px 5px 12px;
    }

    .hero-search input {
        font-size: 12px;
        min-width: 0;
    }

    .hero-search .btn {
        padding: 9px 14px;
        font-size: 12px;
    }

    /* Popular tags — wrap, center */
    .hero-popular {
        justify-content: center;
        gap: 6px 8px;
    }

    .hero-popular-tag {
        font-size: 11.5px;
        padding: 3px 10px;
    }

    /* Laptop mockup — scale to fit */
    .hero-laptop {
        max-width: 320px;
    }

    /* Float icons — tuck closer */
    .hero-float-icon {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .hero-float-icon.fi-1 { top: -6%;  left: 0; }
    .hero-float-icon.fi-2 { top: 12%;  left: 4%; }
    .hero-float-icon.fi-3 { top: 40%;  left: -1%; }
    .hero-float-icon.fi-4 { bottom: 12%; left: 0; top: auto; }
    .hero-float-icon.fi-5 { bottom: -2%; left: 5%; top: auto; }

    /* --- Tools Grid --- */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tool-card {
        padding: 12px;
    }

    .tool-card-icon {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .tool-card-name {
        font-size: 12.5px;
    }

    .tool-card-desc {
        font-size: 11px;
    }

    /* --- Why grid — stay 2-col on 480 --- */
    .why-card:last-child {
        max-width: 100%;
    }

    /* --- Newsletter form wraps on small --- */
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
        padding: 12px;
    }

    /* --- Footer --- */
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-made {
        grid-column: auto;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        gap: 10px 16px;
    }
}

/* =========================================
   TINY MOBILE — 360px
========================================= */
@media (max-width: 360px) {

    .container {
        width: min(100% - 20px, var(--container));
    }

    /* Hide laptop on tiny screens — too cramped */
    .hero-right {
        display: none;
    }

    .hero {
        padding: 36px 0 40px;
    }

    .hero-title {
        font-size: 1.55rem;
    }

    /* Single column tools on tiny */
    .tools-grid {
        grid-template-columns: 1fr;
    }

    /* Why single col */
    .why-grid {
        grid-template-columns: 1fr;
    }

    .why-card:last-child {
        grid-column: auto;
        max-width: 100%;
    }

    .footer-bottom-links {
        flex-direction: column;
        gap: 8px;
    }
}
