/* Indoor Golf - Main Stylesheet
 * Contains extracted inline CSS from base.html for DRY compliance
 */

/* Enhanced focus styles for better accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* ========================================
   Loading Spinner
   ======================================== */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   Alpine.js Helpers
   ======================================== */
/* Hide Alpine elements until initialized */
[x-cloak] { display: none !important; }

/* ========================================
   Mobile Navigation
   ======================================== */
:root {
    --bottom-nav-height: 5rem; /* default; updated via JS */
    --top-nav-height: 0px; /* default; updated via JS */
    --toast-offset: 1rem; /* default spacing for toast stack */
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0.75rem 0.5rem;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.2s ease-in-out;
    min-height: 4rem;
}

.mobile-nav-item.active {
    color: #a28830;
}

.mobile-nav-item:hover {
    color: #a28830;
    background-color: #f9fafb;
}

.mobile-nav-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.mobile-nav-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.mobile-copyright {
    text-align: center;
    font-size: 0.625rem;
    color: #9ca3af;
    padding: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

/* ========================================
   Mobile Responsive Rules (< 640px)
   ======================================== */
@media (max-width: 639px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    .mobile-top-nav {
        position: fixed;
        top: env(safe-area-inset-top, 0);
        left: 0;
        right: 0;
        width: 100%;
        z-index: 60;
    }
    
    body.has-mobile-top-nav main {
        padding-top: var(--top-nav-height, 0px);
        scroll-padding-top: var(--top-nav-height, 0px);
    }
    
    body.has-mobile-top-nav .mobile-top-nav {
        padding-top: env(safe-area-inset-top, 0);
        background-color: white;
    }
    
    /* Add padding to main content to prevent overlap with bottom nav */
    main {
        padding-bottom: calc(var(--bottom-nav-height, 5rem) + max(1rem, env(safe-area-inset-bottom)));
        scroll-padding-bottom: calc(var(--bottom-nav-height, 5rem) + env(safe-area-inset-bottom));
    }
    
    /* Improve touch targets on mobile */
    .btn, button, a[role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better form spacing on mobile */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Improve modal dialogs on mobile */
    .modal, [role="dialog"] {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* ========================================
   Typography
   ======================================== */
body {
    font-family: 'Inter', sans-serif;
    /* Improve viewport sizing on mobile browsers */
    min-height: 100dvh;
}
