/*
Mobile Styles for SCDev Theme Sheer
Responsive header with social icons, menu dropdown, logo, and user button
*/

@media (max-width: 768px) {
    /* Force responsive layout */
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Make page full width on mobile */
    #page {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    /* Top header with social icons - scrollable */
    .top-header {
        display: flex !important;
        justify-content: center;
        position: static;
        width: 100% !important;
        padding: 10px 15px !important;
        box-sizing: border-box;
        height: auto !important;
        min-height: 50px;
    }
    
    /* Hide the left side (title/logo) */
    .top-header-left {
        display: none;
    }
    
    /* Center the social icons and make them responsive */
    .top-header-right {
        position: static;
        left: auto;
        transform: none;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 8px;
        width: auto;
        max-width: 90%;
    }
    
    /* Make social icons touch-friendly on mobile */
    .top-header .social-icons a {
        font-size: 16px !important;
        padding: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        min-height: 36px;
        border-radius: 50%;
        transition: background 0.3s;
    }
    
    .top-header .social-icons a:hover {
        background: rgba(255,255,255,0.2);
    }
    
    /* Hide user button in top header on mobile only */
    .top-header .hn-user-menu-header {
        display: none !important;
    }
    
    /* Mobile Navigation Bar - Sticky */
    .horizontal-nav {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px !important;
        box-sizing: border-box;
        position: sticky !important;
        top: 0;
        background: #fff;
        z-index: 998;
        height: 60px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        width: 100% !important;
        position: relative;
    }
    
    /* Hamburger Menu Button - Left */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: 2px solid #3498db;
        font-size: 20px;
        color: #3498db;
        cursor: pointer;
        padding: 6px 12px;
        border-radius: 25px;
        transition: all 0.3s;
        width: auto;
        height: auto;
        order: 1;
        flex-shrink: 0;
        font-weight: 600;
        white-space: nowrap;
    }
    
    .mobile-menu-btn:hover {
        background: #3498db;
        color: #fff;
    }
    
    .mobile-menu-btn::before {
        content: "☰";
        font-size: 18px;
    }
    
    /* Logo/Site Title - Center */
    .horizontal-nav .mobile-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
        max-width: 50%;
        z-index: 1;
    }
    
    .horizontal-nav .mobile-logo a {
        display: flex;
        align-items: center;
        text-decoration: none;
    }
    
    .horizontal-nav .mobile-logo .header-custom-logo {
        height: 40px !important;
        width: auto !important;
        max-width: 120px !important;
        object-fit: contain;
        border-radius: 4px !important;
    }
    
    .horizontal-nav .mobile-logo .header-site-title {
        font-size: 18px !important;
        font-weight: 600;
        color: #333;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* User Menu - Right */
    .horizontal-nav .hn-user-menu {
        position: relative;
        display: flex !important;
        align-items: center;
        flex-shrink: 0;
        order: 3;
        z-index: 1;
    }
    
    .horizontal-nav .hn-user-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: 2px solid #3498db;
        cursor: pointer;
        padding: 6px 10px;
        border-radius: 25px;
        font-size: 14px;
        color: #3498db;
        font-family: inherit;
        transition: all 0.3s;
        font-weight: 600;
        white-space: nowrap;
    }
    
    .horizontal-nav .hn-user-btn:hover {
        background: #3498db;
        color: #fff;
    }
    
    .horizontal-nav .hn-avatar {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover;
        display: block;
        border: 2px solid rgba(52, 152, 219, 0.3);
        flex-shrink: 0;
    }
    
    .horizontal-nav .hn-login-btn {
        padding: 8px 16px;
        border-radius: 25px;
        background: #3498db;
        color: #fff !important;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        transition: background 0.3s;
        border: 2px solid #3498db;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    .horizontal-nav .hn-login-btn:hover {
        background: #2980b9;
        border-color: #2980b9;
    }
    
    /* Mobile Dropdown Menu - HIDDEN BY DEFAULT */
    .mobile-menu-dropdown {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        z-index: 999;
        max-height: 70vh;
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }
    
    /* Show mobile menu ONLY when active */
    .mobile-menu-dropdown.active {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .mobile-menu-dropdown ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .mobile-menu-dropdown li {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-menu-dropdown li:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-dropdown a {
        display: block;
        padding: 15px 20px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
        transition: background 0.3s;
    }
    
    .mobile-menu-dropdown a:hover {
        background: #f8f9fa;
        color: #3498db;
    }
    
    /* Hide desktop navigation on mobile */
    .horizontal-nav .desktop-nav {
        display: none !important;
    }
    
    /* Hide desktop main navigation on mobile */
    .horizontal-nav .main-navigation {
        display: none !important;
    }
    
    /* Hide desktop sidebar completely */
    .sidebar {
        display: none !important;
    }
    
    /* Make content full width */
    .main-wrapper {
        flex-direction: column;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .content-wrapper {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Add mobile padding to content */
    .site-content {
        padding: 20px 15px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Mobile-friendly footer */
    .site-footer {
        padding: 20px 15px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-left,
    .footer-right {
        position: static;
        transform: none;
        order: unset;
    }
    
    .footer-right ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .night-mode-toggle {
        position: static;
        transform: none;
        margin: 10px auto 0;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .top-header {
        padding: 8px 10px !important;
    }
    
    .top-header-right {
        gap: 6px;
        max-width: 85%;
    }
    
    .top-header .social-icons a {
        min-width: 32px;
        min-height: 32px;
        font-size: 14px !important;
        padding: 4px;
    }
    
    .horizontal-nav {
        padding: 0 10px !important;
        height: 55px !important;
    }
    
    .horizontal-nav .site-title {
        font-size: 16px;
    }
    
    .horizontal-nav .custom-logo {
        max-width: 80px;
        max-height: 35px;
    }
    
    .hn-user-btn {
        padding: 5px 8px;
        font-size: 13px;
        gap: 4px;
    }
    
    .hn-avatar {
        width: 24px;
        height: 24px;
    }
    
    .site-content {
        padding: 15px 10px;
    }
}