/* PWA Enhancement Styles */

/* App-like UI Improvements */
:root {
    --app-primary: #ff005e;
    --app-secondary: #0056b3;
    --app-background: #f8f9fa;
    --app-text: #333333;
    --app-border: #e0e0e0;
    --app-shadow: rgba(0, 0, 0, 0.1);
}

/* Apply app-like styles when in standalone mode */
@media all and (display-mode: standalone) {
    body {
        /* Remove browser-specific margins */
        margin: 0;
        padding: 0;
        /* Prevent overscroll/bounce effect */
        overscroll-behavior: none;
        /* Improve touch response */
        touch-action: manipulation;
        /* Prevent text selection for app-like feel */
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Hide browser UI elements that might still show */
    .browser-only {
        display: none !important;
    }
    
    /* Add app-like header */
    .main-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background-color: white;
        box-shadow: 0 2px 4px var(--app-shadow);
    }
    
    /* Add app-like bottom navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 -2px 5px var(--app-shadow);
        z-index: 1000;
        padding: 10px 0;
        justify-content: space-around;
    }
    
    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: var(--app-text);
        text-decoration: none;
        font-size: 12px;
    }
    
    .mobile-bottom-nav a.active {
        color: var(--app-primary);
    }
    
    .mobile-bottom-nav .nav-icon {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    /* Add padding to main content to account for bottom nav */
    .main-content {
        padding-bottom: 60px;
    }
    
    /* Improve button styles for touch */
    button, .btn, [type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve form elements for touch */
    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    /* Add pull-to-refresh indicator */
    .pull-to-refresh {
        position: absolute;
        top: -50px;
        left: 0;
        right: 0;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s;
    }
    
    /* App install banner styles */
    .app-install-banner {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        padding: 10px 15px;
        border-top: 3px solid var(--app-primary);
        display: flex;
        align-items: center;
    }
    
    .banner-content {
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .banner-text {
        flex: 1;
        margin-left: 15px;
    }
    
    .banner-text h3 {
        margin: 0;
        font-size: 16px;
        color: var(--app-text);
    }
    
    .banner-text p {
        margin: 5px 0 0;
        font-size: 14px;
        color: #666;
    }
    
    .banner-buttons {
        display: flex;
        gap: 10px;
    }
    
    .install-now {
        background-color: var(--app-primary);
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 4px;
        font-weight: bold;
        cursor: pointer;
    }
    
    .dismiss-banner {
        background-color: transparent;
        border: 1px solid var(--app-border);
        padding: 8px 15px;
        border-radius: 4px;
        cursor: pointer;
    }
    
    /* Splash screen effect */
    .splash-screen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: white;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: opacity 0.5s;
    }
    
    .splash-logo {
        width: 120px;
        height: 120px;
        margin-bottom: 20px;
        animation: pulse 1.5s infinite;
    }
    
    @keyframes pulse {
        0% { transform: scale(0.95); }
        50% { transform: scale(1.05); }
        100% { transform: scale(0.95); }
    }
    
    .splash-loading {
        width: 50px;
        height: 50px;
        border: 3px solid var(--app-border);
        border-top: 3px solid var(--app-primary);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f44336;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 14px;
    z-index: 9999;
    display: none;
}

body.offline .offline-indicator {
    display: block;
}

/* Thank you message after installation */
.thank-you-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    text-align: center;
    max-width: 300px;
}

.thank-you-message h3 {
    color: var(--app-primary);
    margin-top: 0;
}

.thank-you-message button {
    background-color: var(--app-primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    margin-top: 15px;
    cursor: pointer;
}

/* Install button */
.install-button {
    background-color: var(--app-primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
    display: none; /* Hidden by default, shown by JS when install is available */
}