/* PWA Standalone Mode Styles */
/* These styles only apply when the app is installed and running standalone */

/* Hide browser UI elements when in standalone mode */
@media (display-mode: standalone) {
    /* Hide navigation bar in PWA mode */
    .main-nav {
        display: none !important;
    }
    
    /* Hide profile and notification icons in PWA mode (if nav is visible) */
    .nav-notifications,
    .nav-profile,
    .nav-user {
        display: none !important;
    }
    
    /* Remove top padding since there's no browser UI */
    body {
        padding-top: 0 !important;
    }
    
    /* Adjust container padding for full-screen experience */
    .container {
        padding-top: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Hide navigation elements that aren't needed in app mode */
    .nav-search {
        display: none !important;
    }
    
    .nav-social {
        display: none !important;
    }
    
    /* Make the main nav more app-like */
    .main-nav {
        background: #ffffff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        position: sticky;
        top: 0;
        z-index: 1000;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* App-specific header styling */
    .nav-brand {
        padding: 8px 0;
    }
    
    .nav-logo img {
        height: 32px;
    }
    
    .nav-logo-text {
        font-size: 18px;
        color: #000000 !important;
    }
    
    /* Make navigation more touch-friendly */
    .nav-link {
        padding: 12px 16px !important;
        font-size: 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
        color: #000000 !important;
    }
    
    .nav-link:hover {
        color: #ff3301 !important;
        background-color: rgba(255, 51, 1, 0.1) !important;
    }
    
    /* App-like card styling */
    .meet-card {
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
        border: none;
        overflow: hidden;
    }
    
    .meet-card-header {
        padding: 20px;
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }
    
    .meet-card-body {
        padding: 20px;
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        padding: 12px 24px;
        font-size: 16px;
        border-radius: 12px;
        font-weight: 600;
    }
    
    /* App-like table styling */
    .leaderboard-table {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .leaderboard-table th {
        padding: 16px 12px;
        font-size: 14px;
        font-weight: 700;
    }
    
    .leaderboard-table td {
        padding: 16px 12px;
        font-size: 15px;
    }
    
    /* Enhanced mobile navigation */
    .mobile-menu-toggle {
        display: block !important;
        margin-left: auto;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .nav-links.show {
        transform: translateX(0);
    }
    
    .nav-links .nav-link {
        font-size: 24px;
        margin: 20px 0;
        color: white;
        text-decoration: none;
        padding: 20px;
        border-radius: 12px;
        transition: all 0.3s ease;
        width: 80%;
        text-align: center;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .nav-links .nav-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }
    
    /* App-specific footer */
    footer {
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
        padding: 20px 0;
        margin-top: 40px;
    }
    
    /* Enhanced form styling for app mode */
    .form-control {
        border-radius: 12px;
        padding: 16px;
        font-size: 16px;
        border: 2px solid #e2e8f0;
        transition: all 0.3s ease;
    }
    
    .form-control:focus {
        border-color: #0891b2;
        box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
    }
    
    /* App-like loading states */
    .loading-spinner {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 200px;
    }
    
    .loading-spinner::after {
        content: '';
        width: 40px;
        height: 40px;
        border: 4px solid #e2e8f0;
        border-top: 4px solid #0891b2;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    /* Status bar removed - using native browser status bar instead */
    
    /* Enhanced athlete avatars for app mode */
    .athlete-avatar {
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border: 3px solid white;
    }
    
    /* App-like notification styling */
    .notification-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ef4444;
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
    }
    
    /* Enhanced results table for app mode */
    .results-table-with-avatar {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .results-table-with-avatar th {
        background: linear-gradient(135deg, #0891b2 0%, #0c4a6e 100%);
        color: white;
        padding: 16px 12px;
        font-weight: 600;
    }
    
    /* Quick actions removed - using bottom navigation instead */
}

/* Additional styles for iOS standalone mode */
@media (display-mode: standalone) and (-webkit-touch-callout: none) {
    /* iOS-specific adjustments */
    body {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* PWA Bottom Navigation Enhancements */
@media (display-mode: standalone) {
    /* Hide browser navigation in PWA mode */
    .browser-navigation {
        display: none !important;
    }
    
    /* Show bottom navigation in PWA mode */
    .pwa-navigation {
        display: block !important;
    }
    
    /* Adjust main content for bottom navigation */
    .main-content {
        padding-bottom: 80px !important;
        padding-top: 1% !important;
    }
    
    /* Enhanced bottom navigation for PWA */
    .bottom-nav {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 51, 1, 0.1);
    }
    
    .bottom-nav-item {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .bottom-nav-item:active {
        transform: scale(0.9);
        background-color: rgba(255, 51, 1, 0.2);
    }
    
    .bottom-nav-item.active {
        background-color: rgba(255, 51, 1, 0.15);
        box-shadow: 0 2px 8px rgba(255, 51, 1, 0.3);
    }
    
    /* Add subtle animation to active state */
    .bottom-nav-item.active .material-icons {
        animation: bounce 0.6s ease;
    }
    
    @keyframes bounce {
        0%, 20%, 60%, 100% {
            transform: translateY(0) scale(1.1);
        }
        40% {
            transform: translateY(-4px) scale(1.1);
        }
        80% {
            transform: translateY(-2px) scale(1.1);
        }
    }
    
    /* Adjust footer for PWA mode */
    .footer {
        margin-bottom: 95px;
    }
    
    /* Quick actions removed - using bottom navigation instead */
}

/* Additional styles for Android standalone mode */
@media (display-mode: standalone) and (max-width: 768px) {
    /* Android-specific adjustments */
    .nav-links {
        padding-top: 60px; /* Account for Android status bar */
    }
    
    /* Adjust bottom nav for Android safe area */
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0);
        height: calc(90px + env(safe-area-inset-bottom, 0));
    }
    
    .main-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)) !important;
    }
} 