/* Mobile Menu Professional Fixes */

/* Fix logo stretching on mobile - SMALLER SIZE */
@media only screen and (max-width: 991px) {
    .navbar .navbar-brand img.logo {
        max-width: 80px !important;
        height: auto !important;
        object-fit: contain;
    }
}

@media only screen and (max-width: 480px) {
    .navbar .navbar-brand img.logo {
        max-width: 70px !important;
        height: auto !important;
    }
}

/* Improve hamburger menu design - SMALLER & MORE COMPACT */
@media only screen and (max-width: 991px) {

    /* Modern hamburger button - smaller */
    .navbar-toggler {
        border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 6px !important;
        padding: 6px 8px !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
    }

    .navbar-toggler:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        transform: translateY(-1px);
    }

    .navbar-toggler:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
    }

    /* Hamburger icon styling - smaller */
    .navbar-toggler-icon {
        background: transparent !important;
        width: 22px !important;
        height: 22px !important;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .navbar-toggler-icon.fa {
        background: transparent !important;
        color: #ffffff !important;
        font-size: 16px !important;
        line-height: 22px !important;
    }

    /* Reposition dark/light mode toggle - SMALLER & ALIGNED */
    .cont-ser-position {
        position: fixed !important;
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 1050;
        margin-top: 0 !important;
    }

    /* Center the toggle in navbar height */
    @supports (height: 100dvh) {
        .cont-ser-position {
            top: 22px !important;
            transform: none !important;
        }
    }

    .theme-switch-wrapper {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 50%;
        padding: 6px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .theme-switch {
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
    }

    /* Scale down the sun/moon icons and center them */
    .mode-container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .mode-container i {
        transform: scale(0.8);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Adjust header spacing for fixed toggle - less padding */
    #site-header {
        padding-right: 60px;
    }

    /* Better mobile menu appearance */
    .navbar-collapse {
        background: var(--bg-color);
        border-radius: 12px;
        margin-top: 15px;
        padding: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    }

    .navbar-nav .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 8px 0;
    }

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

    .navbar-nav .nav-link {
        padding: 12px 15px !important;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .navbar-nav .nav-link:hover {
        background: rgba(102, 126, 234, 0.1);
        transform: translateX(5px);
    }
}

/* Extra small devices - even smaller */
@media only screen and (max-width: 480px) {
    .cont-ser-position {
        right: 10px !important;
        top: 10px !important;
    }

    .theme-switch {
        width: 28px !important;
        height: 28px !important;
    }

    .theme-switch-wrapper {
        padding: 5px;
    }

    /* Even smaller icons on tiny screens */
    .mode-container i {
        transform: scale(0.7);
    }

    #site-header {
        padding-right: 50px;
    }

    /* Smaller hamburger on tiny screens */
    .navbar-toggler {
        padding: 5px 7px !important;
    }

    .navbar-toggler-icon {
        width: 20px !important;
        height: 20px !important;
    }

    .navbar-toggler-icon.fa {
        font-size: 14px !important;
        line-height: 20px !important;
    }
}