/* Mobile Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    touch-action: manipulation;
    padding: 12px 20px;
}

/* Prevent zoom on input focus */
input, textarea, select {
    font-size: 16px !important;
    -webkit-appearance: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
        padding-bottom: 80px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 15px;
        min-height: 50px;
        font-size: 18px;
        font-weight: 500;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    .form-control {
        padding: 18px 15px;
        font-size: 18px;
        border-radius: 12px;
        border: 2px solid #e5e5e5;
    }
    
    .form-control:focus {
        border-color: #000;
        box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
    }
    
    .card {
        margin: 5px;
        border-radius: 16px;
        border: none;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    /* Typography scaling */
    h1 { font-size: 2rem; line-height: 1.2; }
    h2 { font-size: 1.6rem; line-height: 1.3; }
    h3 { font-size: 1.4rem; line-height: 1.3; }
    
    /* Navigation improvements */
    .navbar {
        padding: 10px 0;
        background: rgba(255,255,255,0.95) !important;
        backdrop-filter: blur(10px);
    }
    
    .navbar-nav {
        text-align: center;
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        padding: 18px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 18px;
        font-weight: 500;
    }
    
    .navbar-toggler {
        border: none;
        padding: 8px;
    }
    
    /* Page elements */
    .page-header {
        padding: 2rem 0 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    /* Community page fixes */
    .guidelines-card {
        margin-bottom: 2rem;
        padding: 1rem;
    }
    
    .guidelines-content .row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .guideline-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .post-type-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .community-card .card-body {
        padding: 1rem;
    }
    
    .form-control-lg {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .feed-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .sidebar-card {
        margin-top: 1.5rem;
        padding: 1rem;
    }
}

/* Mobile Bottom Navigation */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid #e5e7eb;
        padding: 12px 0;
        z-index: 1000;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .mobile-nav-item {
        text-align: center;
        padding: 10px 8px;
        text-decoration: none;
        color: #6b7280;
        font-size: 11px;
        font-weight: 500;
        display: flex;
        flex-direction: column;
        align-items: center;
        transition: all 0.2s ease;
        border-radius: 6px;
    }
    
    .mobile-nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
        transition: transform 0.2s ease;
    }
    
    .mobile-nav-item.active,
    .mobile-nav-item:hover {
        color: #111827;
        background: rgba(0, 0, 0, 0.05);
    }
    
    .mobile-nav-item:hover i {
        transform: scale(1.1);
    }
}

/* Small Mobile Devices */
@media (max-width: 414px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .btn-lg {
        padding: 18px 25px;
        font-size: 18px;
        min-height: 55px;
    }
    
    .form-control {
        padding: 20px 15px;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}