/* PWA Mobile App Styling for Receipts to Rewards */

/* Mobile-first responsive design */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* PWA-specific styles */
.pwa-container {
    min-height: 100vh;
    background: #f8f9fa;
}

.pwa-header {
    background: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.pwa-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pwa-title {
    color: #dc3545;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.pwa-subtitle {
    color: #666;
    font-size: 16px;
    margin: 5px 0 0 0;
    font-weight: 400;
}

/* Mobile navigation improvements */
.navbar {
    background: white !important;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.navbar-brand {
    font-weight: 700;
    color: #2E7D32 !important;
}

/* Card styling for mobile */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.card-body {
    padding: 25px;
}

/* Mobile-optimized buttons */
.btn {
    border-radius: 25px;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #dc3545;
    color: white;
}

.btn-primary:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-light {
    background: #f8f9fa;
    color: #2E7D32;
    border: 1px solid #e9ecef;
}

.btn-light:hover {
    background: #e9ecef;
    color: #1B5E20;
}

/* Mobile bottom navigation */
.navbar.fixed-bottom {
    background: white !important;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 10px 0;
}

.navbar.fixed-bottom .container {
    padding: 0 20px;
}

.navbar.fixed-bottom a {
    color: #666 !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar.fixed-bottom a:hover,
.navbar.fixed-bottom a.active {
    color: #2E7D32 !important;
}

.navbar.fixed-bottom i {
    font-size: 20px;
    margin-bottom: 5px;
}

.navbar.fixed-bottom .small {
    font-size: 11px;
    font-weight: 500;
}

/* PWA-specific animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile-first responsive utilities */
.pwa-mobile-only {
    display: block;
}

.pwa-desktop-only {
    display: none;
}

/* PWA status bar styling */
.pwa-status-bar {
    background: #2E7D32;
    color: white;
    padding: 8px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

/* Mobile app-like spacing */
.pwa-section {
    padding: 20px;
    margin: 20px 0;
}

.pwa-section-title {
    color: #dc3545;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

/* PWA install button styling */
.pwa-install-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    text-align: center;
    text-decoration: none;
}

.pwa-install-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    color: white;
    text-decoration: none;
}

/* Mobile app splash screen styling */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeOut 0.5s ease 2s forwards;
}

.pwa-splash-logo {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: scaleIn 0.8s ease 0.5s both;
    overflow: hidden;
}

.splash-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
}

.pwa-splash-title {
    color: #dc3545;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    animation: slideUp 0.8s ease 1s both;
}

.pwa-splash-subtitle {
    color: #6c757d;
    font-size: 16px;
    text-align: center;
    animation: slideUp 0.8s ease 1.2s both;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Responsive design */
@media (min-width: 768px) {
    .pwa-mobile-only {
        display: none;
    }
    
    .pwa-desktop-only {
        display: block;
    }
    
    .pwa-container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .pwa-header {
        border-radius: 0 0 20px 20px;
        margin: 0 20px;
    }
}

@media (max-width: 767px) {
    .pwa-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .pwa-title {
        font-size: 20px;
    }
    
    .pwa-subtitle {
        font-size: 14px;
    }
}

/* PWA offline indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #FF9800;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
}

/* PWA update notification */
.pwa-update-banner {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: #2196F3;
    color: white;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.pwa-update-banner button {
    background: white;
    color: #2196F3;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
}

/* PWA welcome screen */
.pwa-welcome {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 20px;
    margin: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.pwa-welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.pwa-welcome h2 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 24px;
}

.pwa-welcome p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* PWA loading states */
.pwa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

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

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