/**
 * Fantha Tracks PWA Styles
 */

/* Bottom Navigation */
.fantha-pwa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.fantha-pwa-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 11px;
    padding: 4px 12px;
    transition: color 0.2s;
}

.fantha-pwa-bottom-nav a svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

/* Sidebar Navigation */
.fantha-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 99998;
}

.fantha-sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.fantha-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 99999;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.fantha-sidebar.open {
    left: 0;
}

.fantha-sidebar-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.fantha-sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.fantha-sidebar-nav {
    padding: 16px 0;
}

.fantha-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.fantha-sidebar-item:hover {
    background: #f5f5f5;
}

.fantha-sidebar-item svg {
    width: 20px;
    height: 20px;
}

.fantha-sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 99997;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Skeleton */
.fantha-loading-skeleton {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.fantha-skeleton-header {
    height: 60px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: fantha-skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 20px;
}

.fantha-skeleton-content {
    flex: 1;
}

.fantha-skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: fantha-skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.fantha-skeleton-line.short {
    width: 60%;
}

@keyframes fantha-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Offline Indicator */
.fantha-offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ef4444;
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    z-index: 99999;
}

/* Update Prompt */
.fantha-update-prompt {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    z-index: 99998;
}

.fantha-update-prompt p {
    flex: 1;
    margin: 0;
    font-weight: 500;
}

.fantha-update-prompt button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

#fantha-update-btn {
    background: #4F46E5;
    color: #fff;
}

#fantha-update-dismiss {
    background: #f0f0f0;
    color: #333;
}

/* Install Prompt */
.fantha-install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
}

.fantha-install-content {
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.fantha-install-content h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.fantha-install-content p {
    margin: 0 0 20px;
    color: #666;
}

.fantha-install-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.fantha-install-buttons button {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

#fantha-install-btn {
    background: #4F46E5;
    color: #fff;
}

#fantha-install-dismiss {
    background: #f0f0f0;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .fantha-sidebar-toggle {
        display: flex;
    }
}

@media (min-width: 769px) {
    .fantha-sidebar-toggle {
        display: none;
    }
    
    .fantha-sidebar {
        left: 0;
    }
    
    .fantha-sidebar-overlay {
        display: none;
    }
}
