/* ==========================================================================
   SkillBridge — Responsive fixes (layout + mobile)
   --------------------------------------------------------------------------
   Loaded LAST in every layout, so these rules win over design-system,
   app-shell, page CSS and theme-overrides. No colours, fonts or brand
   styles are changed here — this file only fixes layout / overflow /
   stacking behaviour on tablets and phones.
   ========================================================================== */

/* --- Global horizontal-overflow safeguards ------------------------------ */
html,
body {
    overflow-x: clip;
}

/* Fallback for browsers without `overflow: clip` support. */
@supports not (overflow: clip) {
    html,
    body {
        overflow-x: hidden;
    }
}

img,
video,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

/* Long words / URLs must never force a horizontal scrollbar. */
p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
a {
    overflow-wrap: break-word;
}

/* Tables and wide blocks inside cards stay scrollable, not page-wide. */
.table-responsive {
    max-width: 100%;
}

/* ==========================================================================
   Navbar — collapsed (mobile) menu
   ========================================================================== */
@media (max-width: 991.98px) {
    /* The two nav lists are `align-items-center` on desktop; on mobile
       every item must stretch to the full menu width. */
    #navbarContent .navbar-nav,
    #navbarResponsive .navbar-nav {
        align-items: stretch !important;
        width: 100%;
    }

    #navbarContent .nav-item,
    #navbarResponsive .nav-item {
        width: 100%;
    }

    #navbarContent .nav-link,
    #navbarResponsive .nav-link {
        padding: 0.65rem 0.25rem;
    }

    /* Dropdowns open inline inside the collapsed menu instead of
       floating off-screen. */
    #navbarContent .dropdown-menu,
    #navbarResponsive .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        max-width: 100%;
        border: 0;
        box-shadow: none;
        transform: none !important;
    }

    /* The notification / message dropdowns carry a fixed 380px inline
       width — on a phone that would overflow the viewport. */
    #navbarContent .activity-menu,
    #navbarContent .messages-menu {
        width: calc(100vw - 2rem) !important;
        max-width: 380px;
    }

    /* Guest auth links become full-width buttons in the mobile menu. */
    #navbarContent .sb-auth-login,
    #navbarContent .sb-auth-register,
    #navbarResponsive .sb-auth-login,
    #navbarResponsive .sb-auth-register {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.7rem 1rem;
        border-radius: 0.5rem;
        margin: 0.25rem 0;
        font-weight: 600;
    }

    #navbarContent .sb-auth-login,
    #navbarResponsive .sb-auth-login {
        border: 1px solid #0f766e;
        color: #0f766e;
    }

    #navbarContent .sb-auth-register,
    #navbarResponsive .sb-auth-register {
        background: #0f766e;
        color: #ffffff;
        margin-left: 0 !important;
    }
}

/* Dropdown menus must never be wider than the viewport. */
.navbar .dropdown-menu {
    max-width: calc(100vw - 1.5rem);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    overflow: hidden;
}

.footer .social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.footer .social-links > * {
    margin-right: 0 !important;
}

/* ==========================================================================
   Hero — tablet range (992px–1200px): the floating visual cards are
   320px wide inside a ~25% column, which clipped/overflowed the hero
   around 1125px. Hide the visual column here and let the text go
   full width; the cards reappear (stacked) below 992px per home.css.
   ========================================================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-section .hero-visual,
    .hero-section .row > .col-lg-3 {
        display: none;
    }

    .hero-section .row > .col-lg-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ==========================================================================
   Hero — phones (below 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
    /* Decorative floating icons / particles are hidden on phones. */
    .hero-section .floating-elements,
    .hero-section .particles-container {
        display: none !important;
    }

    .hero-section {
        padding: 56px 0;
    }

    .hero-title {
        font-size: 2rem !important;
        line-height: 1.15;
        margin-bottom: 16px;
    }

    .hero-subtitle {
        font-size: 1.05rem;
        line-height: 1.6;
        margin-bottom: 24px;
    }

    /* Trust banner wraps instead of forcing a wide row. */
    .trust-banner {
        display: block;
        max-width: 100%;
        padding: 14px 18px;
        border-radius: 20px;
        margin-bottom: 28px;
    }

    .trust-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* Stats grid: tighter padding, smaller numbers. */
    .stats-bar {
        margin: 28px 0;
    }

    .stats-grid {
        padding: 20px 16px;
        gap: 16px;
    }

    .stats-bar .stat-value {
        font-size: 2rem;
    }

    /* Search box stacks cleanly. */
    .ai-search-container {
        padding: 20px 16px;
        margin: 28px 0;
    }

    .search-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .search-input {
        height: 52px;
        padding: 0 16px 0 44px;
        font-size: 15px;
    }

    .search-suggestions {
        flex-wrap: wrap;
        gap: 12px;
    }

    .suggestions {
        flex-wrap: wrap;
    }

    /* Hero CTAs go full width (overrides the old 44% / 111% sizing). */
    .hero-actions {
        max-width: 100% !important;
        flex-direction: column;
        align-items: stretch;
        margin-top: 28px;
    }

    .hero-actions .btn,
    .hero-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }

    /* Section paddings: 100px is far too tall on a phone. */
    .enterprise-section,
    .workflow-section,
    .pricing-section,
    .stats-section,
    .cta-section {
        padding: 56px 0;
    }

    .section-intro {
        margin-bottom: 36px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .cta-features {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    /* Footer columns: brand full width, link columns 2 per row
       (Bootstrap col-6 already handles the links). */
    .footer .row > .col-md-6:first-child {
        margin-bottom: 1.5rem;
    }
}

/* ==========================================================================
   Small phones (below 576px)
   ========================================================================== */
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.75rem !important;
    }

    .stats-bar .stat-value {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 12px;
    }

    .search-btn {
        min-width: 0;
        padding: 0 24px;
    }

    .trust-badge {
        font-size: 13px;
    }
}
