/* Mobile-First PWA Styles for Nabatak */

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 90%;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Enhanced Mobile Navigation */
@media (max-width: 768px) {
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #ddd;
        padding: 10px 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    .mobile-nav .nav-item {
        flex: 1;
        text-align: center;
    }
    
    .mobile-nav .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 5px;
        color: #666;
        text-decoration: none;
        font-size: 12px;
    }
    
    .mobile-nav .nav-link i {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .mobile-nav .nav-link.active {
        color: #8bc34a;
    }
    
    /* Add bottom padding to body to account for fixed nav */
    body {
        padding-bottom: 70px;
    }
}

/* Touch-Friendly Form Elements */
@media (max-width: 768px) {
    .form-control, .form-select, .btn {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 12px 20px;
        margin: 5px 0;
    }
    
    /* Larger touch targets for checkboxes and radios */
    .form-check-input {
        width: 1.5em;
        height: 1.5em;
    }
    
    .form-check-label {
        padding-left: 10px;
        font-size: 16px;
    }
}

/* Improved Weather Visualization for Mobile */
@media (max-width: 768px) {
    .weather-widget {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .weather-card {
        background: linear-gradient(135deg, #8bc34a, #689f38);
        color: white;
        padding: 20px;
        border-radius: 12px;
        text-align: center;
        box-shadow: 0 4px 15px rgba(139, 195, 74, 0.3);
    }
    
    .weather-icon {
        font-size: 48px;
        margin-bottom: 10px;
    }
    
    .weather-temp {
        font-size: 32px;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .weather-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 15px;
    }
    
    .weather-detail-item {
        background: rgba(255,255,255,0.2);
        padding: 10px;
        border-radius: 8px;
        text-align: center;
    }
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff5722;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 9999;
    display: none;
}

.offline-indicator.show {
    display: block;
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% { transform: translateX(-50%) scale(0.3); opacity: 0; }
    50% { transform: translateX(-50%) scale(1.05); }
    70% { transform: translateX(-50%) scale(0.9); }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Enhanced Card Layout for Mobile */
@media (max-width: 768px) {
    .card {
        border-radius: 12px;
        box-shadow: 0 2px 15px rgba(0,0,0,0.1);
        margin-bottom: 20px;
    }
    
    .card-header {
        background: linear-gradient(135deg, #8bc34a, #689f38);
        color: white;
        border-radius: 12px 12px 0 0 !important;
        padding: 15px 20px;
    }
    
    .card-body {
        padding: 20px;
    }
}

/* Swipe Gestures Support */
.swipe-container {
    touch-action: pan-y;
    position: relative;
    overflow: hidden;
}

.swipe-item {
    transition: transform 0.3s ease-out;
}

.swipe-item.swiping {
    transition: none;
}

/* Enhanced Typography for Mobile */
@media (max-width: 768px) {
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    h5 { font-size: 14px; }
    h6 { font-size: 13px; }
    
    .lead { font-size: 18px; }
    
    /* Ensure good contrast */
    .text-muted {
        color: #666 !important;
    }
}

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

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

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

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d2d2d;
        color: #ffffff;
        border-color: #444;
    }
    
    .form-control {
        background-color: #3d3d3d;
        border-color: #555;
        color: #ffffff;
    }
    
    .form-control:focus {
        background-color: #3d3d3d;
        border-color: #8bc34a;
        color: #ffffff;
        box-shadow: 0 0 0 0.2rem rgba(139, 195, 74, 0.25);
    }
}

/* Install Button Styling */
.install-btn {
    background: linear-gradient(135deg, #8bc34a, #689f38);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(139, 195, 74, 0.3);
    transition: all 0.3s ease;
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 195, 74, 0.4);
}

/* Enhanced Store Link for Mobile */
@media (max-width: 768px) {
    .store-link-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #8bc34a, #689f38);
        color: white;
        padding: 15px;
        text-align: center;
        z-index: 999;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }
    
    .store-link-mobile a {
        color: white;
        text-decoration: none;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .store-link-mobile a:hover {
        color: #f0f0f0;
    }
}