/* Mobile Responsive Styles */

/* Mobile First Approach */
@media (max-width: 768px) {
    /* Base adjustments */
    body {
        font-size: 15px;
    }
    
    /* Navbar Mobile */
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .nav-container {
        position: relative;
    }
    
    .logo {
        font-size: 1.35rem;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--bg-elevated);
        border: none;
        border-radius: var(--radius);
        color: var(--text-primary);
        font-size: 1.25rem;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        position: relative;
        z-index: 1001;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    /* Navigation Links - Mobile Drawer */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: flex-start;
        padding: 5rem 1.5rem 2rem;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-links.show {
        transform: translateX(0);
    }
    
    .nav-links::before {
        content: 'Menu';
        position: absolute;
        top: 1.25rem;
        left: 1.5rem;
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text-primary);
    }
    
    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links a {
        display: flex;
        align-items: center;
        padding: 1.25rem 0;
        font-size: 1.1rem;
        border-radius: 0;
    }
    
    .nav-links a::before {
        content: '';
        display: inline-block;
        width: 8px;
        height: 8px;
        background: var(--primary);
        border-radius: 50%;
        margin-right: 1rem;
        opacity: 0;
        transition: opacity 0.2s;
    }
    
    .nav-links a.active::before {
        opacity: 1;
    }
    
    /* Nav Actions Mobile */
    .nav-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .theme-toggle {
        position: static;
        width: 44px;
        height: 44px;
        transform: none !important;
    }
    
    .steam-login-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .steam-login-btn span {
        display: none;
    }
    
    /* Main Content */
    .main-content {
        margin-top: 70px;
        padding: 1rem;
    }
    
    /* Hero Section Mobile */
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 2.25rem;
        letter-spacing: -1px;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Server Cards Mobile */
    .server-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .server-card {
        padding: 1.25rem;
    }
    
    .server-header {
        margin-bottom: 0.75rem;
    }
    
    .server-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    
    .server-info h3 {
        font-size: 1.1rem;
    }
    
    .server-info span {
        font-size: 0.8rem;
    }
    
    .server-status {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .server-stats {
        padding-top: 0.75rem;
        gap: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    /* Section Headers Mobile */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1.35rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* News Cards Mobile */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .news-image {
        height: 160px;
    }
    
    .news-content {
        padding: 1.25rem;
    }
    
    .news-card h3 {
        font-size: 1.1rem;
    }
    
    /* Leaderboard Mobile */
    .leaderboard {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .leaderboard-header,
    .leaderboard-row {
        min-width: 500px;
    }
    
    .leaderboard-row {
        padding: 0.875rem;
    }
    
    .rank {
        font-size: 1.1rem;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
    
    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .stat-card-label {
        font-size: 0.8rem;
    }
    
    /* Footer Mobile */
    .footer {
        padding: 2rem 1rem 1.5rem;
        margin-top: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .footer-section a {
        font-size: 0.875rem;
    }
    
    /* Admin Layout Mobile */
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    /* Admin Mobile Menu Toggle */
    .admin-mobile-toggle {
        display: flex !important;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1000;
        width: 44px;
        height: 44px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        cursor: pointer;
    }
    
    .admin-content {
        padding-top: 4rem;
    }
    
    /* Tables Mobile */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Forms Mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Bottom Navigation Bar */
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        padding: 0.5rem;
        z-index: 1000;
        justify-content: space-around;
    }
    
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.5rem;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.7rem;
        gap: 0.25rem;
        flex: 1;
        transition: color 0.2s;
    }
    
    .bottom-nav-item.active {
        color: var(--primary);
    }
    
    .bottom-nav-item span:first-child {
        font-size: 1.25rem;
    }
    
    /* Add padding to main content for bottom nav */
    body {
        padding-bottom: 70px;
    }
    
    /* Touch-friendly buttons */
    button, .btn, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent text selection on buttons */
    button, .btn {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Toast positioning for mobile */
    #toast-container {
        top: auto;
        bottom: 80px;
        left: 1rem;
        right: 1rem;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        padding: 0.875rem 1rem;
    }
    
    /* Swipe indicator */
    .swipe-indicator {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .swipe-dot {
        width: 8px;
        height: 8px;
        background: var(--bg-elevated);
        border-radius: 50%;
        transition: background 0.2s;
    }
    
    .swipe-dot.active {
        background: var(--primary);
        width: 24px;
        border-radius: 4px;
    }
    
    /* Pull to refresh hint */
    .pull-to-refresh {
        text-align: center;
        padding: 1rem;
        color: var(--text-secondary);
        font-size: 0.875rem;
    }
    
    .pull-to-refresh::before {
        content: '↓ ';
    }
}

/* Small phones */
@media (max-width: 375px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .server-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .bottom-nav-item span:last-child {
        font-size: 0.65rem;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .server-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screens - hide mobile elements */
@media (min-width: 769px) {
    .mobile-menu-toggle,
    .bottom-nav,
    .admin-mobile-toggle {
        display: none !important;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .server-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }
    
    .bottom-nav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }
    
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}
