/* PWA UI styles are disabled in web-only mode. Keeping file to avoid 404s from existing links. */
/* You may safely remove this stylesheet include from pages when convenient. */

/* existing styles (if any) remain below */

/* PWA Mobile Enhancements */

/* Prevent zoom on input focus */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Improve touch targets */
@media screen and (max-width: 768px) {
    button,
    .btn,
    a,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Menu button improvements for mobile */
    #menu-toggle {
        position: fixed !important;
        top: 1rem !important;
        left: 1rem !important;
        z-index: 9999 !important;
        background: #fff !important;
        border: none !important;
        padding: 0.5rem !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        /* Asigură că butonul rămâne complet vizibil */
        transform: none !important;
        transform-origin: center !important;
        overflow: visible !important;
        will-change: transform !important;
        isolation: isolate !important;
        contain: layout style paint !important;
        /* Previne orice interferență cu scroll */
        position: fixed !important;
        top: 1rem !important;
        left: 1rem !important;
    }
    
    #menu-toggle:hover {
        background: #f8f9fa !important;
        transform: scale(1.05) !important;
    }
    
    #menu-toggle:active {
        transform: scale(0.95) !important;
    }
    
    /* AG Grid mobile improvements */
    .ag-theme-alpine .ag-header-cell {
        min-height: 44px;
    }
    
    .ag-theme-alpine .ag-row {
        min-height: 44px;
    }
    
    .ag-theme-alpine .ag-cell {
        padding: 8px 4px;
        font-size: 14px;
    }
    
    /* Previne interferența cu AG Grid */
    .ag-theme-alpine {
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Asigură că butonul de meniu rămâne deasupra tuturor */
    #menu-toggle {
        position: fixed !important;
        z-index: 9999 !important;
        pointer-events: auto !important;
    }
}

/* PWA Standalone mode improvements */
@media all and (display-mode: standalone) {
    /* Hide browser UI elements */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    /* Improve sidebar for standalone mode */
    .sidebar {
        padding-top: env(safe-area-inset-top);
    }
    
    /* Improve main content for standalone mode */
    .main-content {
        padding-top: calc(2rem + env(safe-area-inset-top));
    }
    
    /* Improve menu button for standalone mode */
    #menu-toggle {
        top: calc(1rem + env(safe-area-inset-top)) !important;
        left: calc(1rem + env(safe-area-inset-left)) !important;
    }
}

.page-footer {
    text-align: center;
    padding: 1.25rem;
    margin: 2rem auto 0;
    border-top: 1px solid rgba(95, 158, 160, 0.15);
    font-size: 0.88rem;
    color: inherit;
    width: 100%;
}

.page-footer a {
    color: var(--primary, #5f9ea0);
    text-decoration: none;
    font-weight: 500;
}

.page-footer a:hover {
    text-decoration: underline;
}

/* PWA Install prompt styling */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #5f9ea0;
    color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease-out;
}

.pwa-install-prompt.show {
    display: block;
}

.pwa-install-prompt .prompt-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pwa-install-prompt .prompt-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.pwa-install-prompt .prompt-buttons {
    display: flex;
    gap: 8px;
}

.pwa-install-prompt .btn-install {
    background: white;
    color: #5f9ea0;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.pwa-install-prompt .btn-dismiss {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

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

/* PWA Offline indicator */
.pwa-offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff6b6b;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

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

/* PWA Update notification */
.pwa-update-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease-out;
}

.pwa-update-notification.show {
    display: block;
}

.pwa-update-notification .update-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pwa-update-notification .update-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.pwa-update-notification .btn-update {
    background: white;
    color: #28a745;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* PWA Loading indicator */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #5f9ea0;
    z-index: 1002;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.pwa-loading.show {
    transform: scaleX(1);
}

/* PWA Touch feedback */
.pwa-touch-feedback {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(95, 158, 160, 0.3);
    pointer-events: none;
    z-index: 999;
    animation: touchRipple 0.6s ease-out;
}

@keyframes touchRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* PWA Swipe gestures */
.pwa-swipe-area {
    touch-action: pan-y;
}

/* PWA Pull to refresh indicator */
.pwa-pull-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #5f9ea0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.pwa-pull-refresh.show {
    transform: translateY(0);
}

/* PWA Bottom navigation for mobile */
@media screen and (max-width: 768px) {
    .pwa-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e9ecef;
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 1000;
        display: flex;
        justify-content: space-around;
    }
    
    .pwa-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px;
        text-decoration: none;
        color: #6c757d;
        font-size: 12px;
        transition: color 0.2s;
    }
    
    .pwa-bottom-nav .nav-item.active {
        color: #5f9ea0;
    }
    
    .pwa-bottom-nav .nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
    }
}

/* PWA Splash screen */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #5f9ea0, #4a7c7e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeOut 0.5s ease-out 2s forwards;
}

.pwa-splash .splash-content {
    text-align: center;
    color: white;
}

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

.pwa-splash .splash-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pwa-splash .splash-subtitle {
    font-size: 16px;
    opacity: 0.8;
}

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

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