/* Mobile App Styles */
body.native-app {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

body.android-app {
    /* Android-specific styles */
}

body.keyboard-open {
    /* Adjust layout when keyboard is open */
}

/* Pull to refresh indicator */
#pull-to-refresh {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #046fa5;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
}

#pull-to-refresh.show {
    top: 20px;
    opacity: 1;
}

/* Network status indicator */
#network-status {
    position: fixed;
    top: -50px;
    left: 0;
    right: 0;
    padding: 12px;
    text-align: center;
    z-index: 9999;
    transition: transform 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

#network-status.online {
    background: #27ae60;
    color: white;
}

#network-status.offline {
    background: #f39c12;
    color: white;
}

#network-status.show {
    transform: translateY(0);
}

/* Mobile notifications */
.mobile-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 300px;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

.notification-content h4 {
    margin: 0 0 8px 0;
    color: #046fa5;
    font-size: 16px;
}

.notification-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
}

.notification-close:hover {
    color: #666;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .mobile-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    #pull-to-refresh {
        font-size: 12px;
        padding: 8px 16px;
    }
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 111, 165, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Touch-friendly buttons */
.btn-mobile {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
}

/* Safe area handling */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* File download progress */
.download-progress {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 9999;
}

.download-progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0;
}

.download-progress-fill {
    height: 100%;
    background: #046fa5;
    transition: width 0.3s ease;
}

.download-progress-text {
    font-size: 12px;
    color: #666;
    text-align: center;
}
