/* YouFood Group PWA Styles */

/* Variables CSS */
:root {
    --pwa-primary-color: #ff6b35;
    --pwa-secondary-color: #f7931e;
    --pwa-success-color: #28a745;
    --pwa-warning-color: #ffc107;
    --pwa-danger-color: #dc3545;
    --pwa-info-color: #17a2b8;
    --pwa-light-color: #f8f9fa;
    --pwa-dark-color: #343a40;
    --pwa-white: #ffffff;
    --pwa-black: #000000;
    --pwa-gray: #6c757d;
    --pwa-gray-light: #e9ecef;
    --pwa-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --pwa-border-radius: 8px;
    --pwa-transition: all 0.3s ease;
}

/* Styles de base pour PWA */
.pwa-container {
    min-height: 100vh;
    background: var(--pwa-white);
}

/* Barre de statut PWA */
.pwa-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: var(--pwa-primary-color);
    z-index: 9999;
    display: none;
}

.pwa-status-bar.visible {
    display: block;
}

/* Bouton d'installation PWA */
.install-pwa-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--pwa-primary-color);
    color: var(--pwa-white);
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--pwa-shadow);
    cursor: pointer;
    z-index: 1000;
    display: none;
    transition: var(--pwa-transition);
}

.install-pwa-btn:hover {
    background: var(--pwa-secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.install-pwa-btn:active {
    transform: translateY(0);
}

/* Toast notifications */
/* .toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--pwa-white);
    color: var(--pwa-dark-color);
    padding: 16px 20px;
    border-radius: var(--pwa-border-radius);
    box-shadow: var(--pwa-shadow);
    z-index: 1001;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.3s ease;
} */

/* .toast-success {
    border-left: 4px solid var(--pwa-success-color);
}

.toast-warning {
    border-left: 4px solid var(--pwa-warning-color);
}

.toast-error {
    border-left: 4px solid var(--pwa-danger-color);
}

.toast-info {
    border-left: 4px solid var(--pwa-info-color);
}

.toast button {
    background: var(--pwa-primary-color);
    color: var(--pwa-white);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
} */

/* Mode hors ligne */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--pwa-warning-color);
    color: var(--pwa-dark-color);
    text-align: center;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9998;
    transform: translateY(-100%);
    transition: var(--pwa-transition);
}

.offline-indicator.visible {
    transform: translateY(0);
}

/* Badge du panier */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--pwa-danger-color);
    color: var(--pwa-white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    display: none;
}

/* Splash screen */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pwa-primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.pwa-splash.hidden {
    opacity: 0;
    pointer-events: none;
}

.pwa-splash-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.pwa-splash-text {
    color: var(--pwa-white);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.pwa-splash-subtitle {
    color: var(--pwa-white);
    opacity: 0.8;
    font-size: 16px;
}

/* Navigation PWA */
.pwa-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--pwa-white);
    border-top: 1px solid var(--pwa-gray-light);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 999;
}

.pwa-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--pwa-gray);
    font-size: 12px;
    transition: var(--pwa-transition);
}

.pwa-nav-item.active {
    color: var(--pwa-primary-color);
}

.pwa-nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

/* Pull to refresh */
.pull-to-refresh {
    position: relative;
    overflow: hidden;
}

.pull-to-refresh-indicator {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pwa-primary-color);
    color: var(--pwa-white);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    transition: var(--pwa-transition);
}

.pull-to-refresh-indicator.visible {
    opacity: 1;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-text {
    height: 16px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: var(--pwa-border-radius);
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    /* .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    } */
    
    .install-pwa-btn {
        bottom: 110px;
        right: 15px;
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --pwa-white: #1a1a1a;
        --pwa-black: #ffffff;
        --pwa-gray: #a0a0a0;
        --pwa-gray-light: #2a2a2a;
    }
    
    .pwa-container {
        background: var(--pwa-white);
        color: var(--pwa-black);
    }
    
    /* .toast {
        background: var(--pwa-gray-light);
        color: var(--pwa-black);
    } */
}

/* Styles pour les raccourcis */
.pwa-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    padding: 20px;
}

.pwa-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--pwa-white);
    border-radius: var(--pwa-border-radius);
    box-shadow: var(--pwa-shadow);
    text-decoration: none;
    color: var(--pwa-dark-color);
    transition: var(--pwa-transition);
}

.pwa-shortcut:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.pwa-shortcut-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.pwa-shortcut-text {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Styles pour les notifications */
.notification-permission {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--pwa-info-color);
    color: var(--pwa-white);
    padding: 16px;
    border-radius: var(--pwa-border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    animation: slideInUp 0.3s ease;
}

.notification-permission button {
    background: var(--pwa-white);
    color: var(--pwa-info-color);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

/* Styles pour le mode standalone */
@media (display-mode: standalone) {
    .pwa-status-bar {
        display: block;
    }
    
    body {
        padding-top: 20px;
    }
}

/* Styles pour les gestes tactiles */
.touch-gesture {
    touch-action: pan-y;
}

.swipeable {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.swipeable-item {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* Styles pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour l'accessibilité */
.pwa-focus-visible:focus-visible {
    outline: 2px solid var(--pwa-primary-color);
    outline-offset: 2px;
} 