/* Mobile Responsiveness - Apple Glass & Optimized */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        /* Matches standard mobile padding */
        width: 100%;
        max-width: 100%;
    }

    /* Hide Desktop Nav Elements */
    .nav-links {
        display: none;
    }

    /* Refined Mobile Top Nav */
    .glass-nav {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #1F2937;
        background: rgba(10, 10, 10, 0.95);
        /* Light Nav */
        height: 60px;
        padding: 0;
        box-shadow: 0 5px 15px rgba(var(--shadow-color), 0.05);
    }

    .glass-nav .container {
        padding: 0 16px;
    }

    .glass-nav .logo {
        margin: 0 auto;
        /* Center logo */
        font-size: 1.3rem;
    }

    .mobile-search-btn {
        display: block;
        /* Show on mobile */
        position: absolute;
        right: 16px;
        color: rgb(var(--text-main));
        font-size: 1.1rem;
    }

    .mobile-logout-btn {
        display: block;
        /* Show on mobile */
        position: absolute;
        right: 50px;
        /* Left of search btn */
        color: rgb(var(--text-muted));
        font-size: 1.1rem;
    }

    /* Premium Mobile Bottom Nav */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.9);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid #1F2937;
        justify-content: space-around;
        align-items: center;
        padding: 10px 0;
        z-index: 2000;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        box-shadow: 0 -5px 20px rgba(var(--shadow-color), 0.05);
    }

    /* ... existing content ... */
    #toast-container {
        bottom: 85px;
        /* Above bottom nav */
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
    }


    .main-content {
        padding-top: 80px;
        /* Reduced top padding for mobile */
        /* padding-bottom: 100px; */
        /* Space for bottom nav */
    }

    .mobile-nav-item {
        color: rgb(var(--text-muted));
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 20%;
        /* Equal width tap targets */
        font-size: 0.7rem;
        /* Tiny labels */
        font-weight: 500;
        gap: 4px;
        position: relative;
        transition: color 0.2s;
    }

    .mobile-nav-item i {
        font-size: 1.5rem;
        /* Larger icons for touch */
        margin-bottom: 2px;
        transition: transform 0.2s;
    }

    .mobile-nav-item.active {
        color: rgb(var(--primary));
    }

    .mobile-nav-item.active i {
        transform: translateY(-2px);
    }

    /* Feed & Card Adjustments */
    .glass-card {
        padding: 1.25rem;
        border-radius: 20px;
        margin-bottom: 1rem;
        border: 1px solid rgb(var(--glass-border));
        /* Inherit premium glass bg from style.css */
    }

    /* Profile Mobile Layout - Stacked & Clean */
    .profile-header {
        margin-bottom: 0;
        padding-bottom: 2rem;
        background: transparent;
        border-radius: 0;
    }

    .profile-cover {
        height: 180px;
        border-radius: 0 0 24px 24px;
        mask-image: none;
        /* remove mask for clarity on small screens */
    }

    .profile-info-container {
        position: static;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -60px;
        /* Overlap cover */
        padding: 0 20px;
        gap: 15px;
    }

    .profile-avatar-large {
        width: 120px;
        height: 120px;
        border-width: 4px;
        background: white;
        /* Match bg to hide transparency issues */
        padding: 3px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .profile-username {
        font-size: 1.8rem;
        margin-top: 5px;
        background: none;
        background-clip: border-box;
        -webkit-background-clip: border-box;
        -webkit-text-fill-color: currentcolor;
        color: rgb(var(--text-main));
    }

    .profile-bio {
        font-size: 0.95rem;
        color: rgb(var(--text-muted));
        max-width: 100%;
        margin: 5px 0;
    }

    .profile-stats-bar {
        justify-content: center;
        gap: 15px;
        width: 100%;
        margin-top: 10px;
        font-size: 0.9rem;
        padding: 12px;
        background: var(--glass-bg);
        border: 1px solid rgb(var(--glass-border));
    }

    .profile-actions {
        width: 100%;
        justify-content: center;
        gap: 10px;
        margin-top: 15px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.9rem;
        flex: 1;
        /* Stretch buttons */
        display: flex;
        justify-content: center;
    }

    /* Auth Containers */
    .auth-container {
        margin: 2rem auto;
        padding: 0 16px;
    }

    /* Toast Position */
    #toast-container {
        bottom: 85px;
        /* Above bottom nav */
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (min-width: 769px) {

    .mobile-bottom-nav,
    .mobile-search-btn {
        display: none;
    }
}