/* 
    Responsive Styles for SM Calculators
    Standard Breakpoints aligned with Bootstrap 5
*/

/* --- Extra Small Devices (Phones, < 576px) --- */
@media (max-width: 575.98px) {
    .navbar-brand img {
        max-height: 35px;
    }

    .custom-navbar .navbar-brand {
        font-size: 1.5rem;
        letter-spacing: 0.01em;
        width: 30%;
    }

    .hero-bar {
        margin-top: 50px;
    }

    .tools-left-bg {
        border-radius: 0;
        padding: 2rem 0;
        box-shadow: none;
        margin-bottom: 2rem;
    }

    .tool-name {
        font-size: 0.9rem;
        font-weight: 600;
        margin-top: 0.5rem;
        letter-spacing: 0.01em;
    }

    .hero-bar .lead {
        font-size: 1rem;
    }

    .seo-section h2 {
        font-size: 1.5rem;
    }

    .seo-section p {
        font-size: 0.9rem;
    }

    .seo-card {
        text-align: center;
    }

    .seo-icon-box {
        margin: 0 auto;
    }

    .seo-title {
        margin-bottom: 0.5rem;
        margin-top: 1rem;
    }

    .mission-box {
        padding: 2rem;
        margin-top: 3rem;

    }

    .mission-title {
        margin-bottom: 0.5rem;
    }

    .error-code {
        font-size: 5rem;
    }

    .error-title {
        font-size: 1.5rem;
    }

    /* Container padding adjustments */
    .container,
    .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Footer adjustments handled in consolidated media query below */
}

/* --- Small Devices (Landscape Phones, 576px and up) --- */
@media (min-width: 576px) and (max-width: 767.98px) {
    .error-code {
        font-size: 6rem;
    }

    .custom-navbar .navbar-brand {
        font-size: 1.5rem;
        letter-spacing: 0.01em;
        width: 30%;
    }

    .hero-bar {
        margin-top: 50px;
    }

    .tools-left-bg {
        border-radius: 0;
        padding: 2rem 0;
        box-shadow: none;
        margin-bottom: 2rem;
    }

    .tool-name {
        font-size: 0.9rem;
        font-weight: 600;
        margin-top: 0.5rem;
        letter-spacing: 0.01em;
    }

    .seo-section h2 {
        font-size: 1.5rem;
    }

    .seo-section p {
        font-size: 0.9rem;
    }

    .seo-card {
        text-align: center;
    }

    .seo-icon-box {
        margin: 0 auto;
    }

    .seo-title {
        margin-bottom: 0.5rem;
        margin-top: 1rem;
    }

    .mission-box {
        padding: 2rem;
        margin-top: 3rem;

    }

    .mission-title {
        margin-bottom: 0.5rem;
    }


    /* Footer adjustments handled in consolidated media query below */
}

/* --- Mobile Menu (Offcanvas) Styles --- */
@media (max-width: 991.98px) {
    .offcanvas {
        width: 85% !important;
        max-width: 320px;
        border-left: none;
        background-color: #1a1c23 !important;
        /* Forced dark background */
        color: #ffffff !important;
    }

    .offcanvas-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1.5rem;
        background-color: #1a1c23 !important;
    }

    .offcanvas-title {
        font-size: 1.25rem;
        font-weight: 700;
        letter-spacing: -0.5px;
        color: #ffffff !important;
    }

    .btn-close-white {
        filter: invert(1) grayscale(100%) brightness(200%);
        /* Ensure close button is visible */
    }

    .offcanvas-body {
        padding: 1.5rem;
        background-color: #1a1c23 !important;
    }

    .navbar-nav .nav-link {
        padding: 0.85rem 0 !important;
        font-size: 1.05rem;
        font-weight: 500;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.85) !important;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        color: #ff5e3a !important;
        padding-left: 8px !important;
        transition: all 0.3s ease;
    }

    .dropdown-menu {
        background: rgba(255, 255, 255, 0.05) !important;
        border: none !important;
        margin-top: 0.5rem !important;
        padding: 0.5rem 1rem !important;
        display: none;
        /* Let bootstrap handle display */
    }

    .dropdown-menu.show {
        display: block !important;
    }

    .dropdown-item {
        color: rgba(255, 255, 255, 0.7) !important;
        padding: 0.75rem 0 !important;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background: transparent !important;
        color: #ff5e3a !important;
        padding-left: 5px !important;
        transition: all 0.2s ease;
    }

    .dropdown-toggle::after {
        color: rgba(255, 255, 255, 0.5);
    }

    #google_translate_element {
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Ensure icons have enough contrast */
    .nav-link i,
    .dropdown-item i {
        color: #ff5e3a !important;
        margin-right: 12px;
        font-size: 1.1rem;
    }

    /* Consolidated Footer Mobile Fix (2 Columns) */
    .footer-dark .footer-main {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 0 !important;
        /* Remove gap to ensure 50% fits */
    }

    .footer-dark .footer-col {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
        margin-bottom: 2rem !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .footer-dark .footer-brand {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        /* Centered */
        gap: 1rem !important;
        /* Smaller gap */
        margin-bottom: 2rem !important;
    }

    .footer-logo {
        margin-bottom: 0 !important;
    }

    .footer-logo img {
        max-height: 40px !important;
        /* Smaller logo for mobile */
        width: auto !important;
    }

    .footer-dark .footer-socials {
        display: flex !important;
        gap: 8px !important;
        /* Smaller gap */
        margin-top: 0 !important;
        justify-content: center !important;
    }

    .footer-socials a {
        width: 32px !important;
        /* Smaller icons for mobile */
        height: 32px !important;
    }

    .footer-socials a i {
        font-size: 0.95rem !important;
    }

    .footer-dark .footer-socials a {
        margin-right: 0 !important;
    }
}