/**
 * PWA Styles - GeoIBRAM Core v2
 * 
 * Estilos públicos do módulo PWA
 * 
 * @package GeoIBRAM\Modules\PWA
 * @version 1.0.0
 */

/* Barra de Progresso */
#geoibram-pwa-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 9999;
    background-color: transparent;
}

#geoibram-pwa-progress-bar .geoibram-pwa-progress-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

#geoibram-pwa-progress-bar[data-position="bottom"] {
    top: auto;
    bottom: 0;
}

/* Botão Fullscreen */
.geoibram-pwa-fullscreen-button {
    position: fixed;
    z-index: 9998;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    min-width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.geoibram-pwa-fullscreen-button:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4), 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.geoibram-pwa-fullscreen-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.geoibram-pwa-fullscreen-button.active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.geoibram-pwa-fullscreen-button.active:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.geoibram-pwa-fullscreen-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.geoibram-pwa-fullscreen-button:hover .geoibram-pwa-fullscreen-icon {
    transform: scale(1.1);
}

.geoibram-pwa-fullscreen-icon-enter,
.geoibram-pwa-fullscreen-icon-exit {
    transition: opacity 0.3s ease;
}

.geoibram-pwa-fullscreen-icon-exit {
    display: none;
}

.geoibram-pwa-fullscreen-button.active .geoibram-pwa-fullscreen-icon-enter {
    display: none !important;
}

.geoibram-pwa-fullscreen-button.active .geoibram-pwa-fullscreen-icon-exit {
    display: block !important;
}

.geoibram-pwa-fullscreen-text {
    white-space: nowrap;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.geoibram-pwa-fullscreen-top_right {
    top: 20px;
    right: 20px;
}

.geoibram-pwa-fullscreen-top_left {
    top: 20px;
    left: 20px;
}

.geoibram-pwa-fullscreen-bottom_right {
    bottom: 20px;
    right: 20px;
}

.geoibram-pwa-fullscreen-bottom_left {
    bottom: 20px;
    left: 20px;
}

/* Botão Flutuante de Instalação - Design Shadcn/UI */
.geoibram-pwa-install-floating-button.geoibram-pwa-install-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.geoibram-pwa-install-floating-button:not(.geoibram-pwa-install-hidden) {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.geoibram-pwa-install-floating-button {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    left: auto !important;
    top: auto !important;
    background: hsl(0, 0%, 9%) !important;
    color: hsl(0, 0%, 98%) !important;
    border: 1px solid hsl(0, 0%, 14.9%) !important;
    border-radius: 0.5rem !important;
    padding: 0.625rem 1.25rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    line-height: 1.25rem !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    z-index: 9997 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    min-width: auto !important;
    white-space: nowrap !important;
    margin: 0 !important;
    vertical-align: middle !important;
    text-align: center !important;
    text-decoration: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.geoibram-pwa-install-floating-button:hover {
    background: hsl(0, 0%, 12%) !important;
    border-color: hsl(0, 0%, 18%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

.geoibram-pwa-install-floating-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.1) !important;
}

.geoibram-pwa-install-floating-button:focus-visible {
    outline: 2px solid hsl(0, 0%, 98%) !important;
    outline-offset: 2px !important;
}

.geoibram-pwa-install-icon {
    width: 1rem !important;
    height: 1rem !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.geoibram-pwa-install-floating-button:hover .geoibram-pwa-install-icon {
    transform: scale(1.05) !important;
}

.geoibram-pwa-install-text {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1.25rem !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Botão de Instalação */
.geoibram-pwa-install-button {
    background: #059669;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2);
}

.geoibram-pwa-install-button:hover {
    background: #047857;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -1px rgba(5, 150, 105, 0.3);
}

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

.geoibram-pwa-install-icon {
    font-size: 20px;
}

/* Modal de Instruções */
.geoibram-pwa-instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.geoibram-pwa-instructions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.geoibram-pwa-instructions-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.geoibram-pwa-instructions-content h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.geoibram-pwa-instructions-content ol {
    margin: 0;
    padding-left: 20px;
}

.geoibram-pwa-instructions-content li {
    margin-bottom: 12px;
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
}

.geoibram-pwa-instructions-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.geoibram-pwa-instructions-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Indicador Offline */
.geoibram-pwa-offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ef4444;
    color: #ffffff;
    padding: 12px 16px;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.geoibram-pwa-offline-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.geoibram-pwa-offline-icon {
    font-size: 20px;
}

.geoibram-pwa-offline-message {
    font-size: 14px;
    font-weight: 500;
}

/* Página Offline */
.geoibram-pwa-offline-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f3f4f6;
    padding: 20px;
}

.geoibram-pwa-offline-container {
    text-align: center;
    max-width: 500px;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.geoibram-pwa-offline-container .geoibram-pwa-offline-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.geoibram-pwa-offline-container h1 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #1f2937;
    font-weight: 700;
}

.geoibram-pwa-offline-container p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.6;
}

.geoibram-pwa-offline-button {
    background: #059669;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.geoibram-pwa-offline-button:hover {
    background: #047857;
    transform: translateY(-1px);
}

.geoibram-pwa-offline-button:active {
    transform: translateY(0);
}

/* Responsivo Mobile */
@media (max-width: 768px) {
    .geoibram-pwa-install-floating-button {
        bottom: 90px !important; /* Acima da tab bar mobile */
        right: 16px !important;
        left: auto !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.8125rem !important;
        border-radius: 0.5rem !important;
    }
    
    /* Se tab bar estiver visível, ajustar posição */
    .geoibram-pwa-tab-bar ~ .geoibram-pwa-install-floating-button {
        bottom: 80px !important;
    }
    
    .geoibram-pwa-install-icon {
        width: 0.875rem !important;
        height: 0.875rem !important;
    }
    
    .geoibram-pwa-install-text {
        font-size: 0.8125rem !important;
    }
    
    .geoibram-pwa-install-button {
        width: 100%;
        justify-content: center;
    }
    
    .geoibram-pwa-instructions-content {
        padding: 20px;
        margin: 20px;
    }
    
    .geoibram-pwa-offline-container {
        padding: 30px 20px;
    }
}

/* ============================================
   FASE 1 - NOVAS FUNCIONALIDADES
   ============================================ */

/* Navigation Tab Bar - APENAS MOBILE */
.geoibram-pwa-tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    display: none; /* Oculto por padrão (desktop) */
    align-items: center;
    justify-content: space-around;
    background-color: #ffffff;
    border-top: 1px solid #e5e5e5;
    z-index: 9998;
}

/* Mostrar APENAS em mobile/tablet */
@media (max-width: 768px) {
    .geoibram-pwa-tab-bar {
        display: flex;
    }
}

/* Garantir que NUNCA apareça em desktop */
@media (min-width: 769px) {
    .geoibram-pwa-tab-bar {
        display: none !important;
    }
}

.geoibram-pwa-tab-bar-bottom {
    bottom: 0;
}

.geoibram-pwa-tab-bar-top {
    top: 0;
    border-top: none;
    border-bottom: 1px solid #e5e5e5;
}

.geoibram-pwa-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-decoration: none;
    color: #666666;
    transition: color 0.3s ease;
    cursor: pointer;
}

.geoibram-pwa-tab-item.active {
    color: #059669;
}

.geoibram-pwa-tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.geoibram-pwa-tab-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.geoibram-pwa-tab-label {
    font-size: 12px;
    font-weight: 500;
}

/* Pull to Refresh */
.geoibram-pwa-pull-refresh {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #f5f5f5;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.geoibram-pwa-pull-refresh-icon {
    width: 24px;
    height: 24px;
    color: #059669;
    transition: transform 0.3s ease;
}

.geoibram-pwa-pull-refresh-text {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

/* Toast Messages */
.geoibram-pwa-toast-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
}

.geoibram-pwa-toast {
    position: relative;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.geoibram-pwa-toast.show {
    opacity: 1;
    transform: translate(0, 0);
}

.geoibram-pwa-toast button {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
}

/* Share Button */
.geoibram-pwa-share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: #059669;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.geoibram-pwa-share-button:hover {
    background-color: #047857;
}

.geoibram-pwa-share-icon {
    font-size: 18px;
}

/* Wake Lock Toggle Button */
.geoibram-pwa-wake-lock-toggle {
    position: fixed;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    bottom: 140px;
    right: 20px;
}

.geoibram-pwa-wake-lock-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.geoibram-pwa-wake-lock-toggle.active {
    background: rgba(5, 150, 105, 0.9);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .geoibram-pwa-tab-bar {
        height: 64px;
    }
    
    .geoibram-pwa-tab-item {
        padding: 6px;
    }
    
    .geoibram-pwa-tab-label {
        font-size: 11px;
    }
    
    .geoibram-pwa-wake-lock-toggle {
        bottom: 160px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

