/**
 * LandSalesPro PWA Styles
 * Styles for install banner, offline indicator, and PWA UI elements
 */

/* Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: -120px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
}

.pwa-banner-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-banner-icon svg {
    width: 28px;
    height: 28px;
}

.pwa-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-banner-text strong {
    font-size: 1rem;
    font-weight: 600;
}

.pwa-banner-text span {
    font-size: 0.85rem;
    opacity: 0.9;
}

.pwa-install-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.pwa-install-btn:hover {
    background: #f0f0f0;
    transform: scale(1.02);
}

.pwa-dismiss-btn {
    background: transparent;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.pwa-dismiss-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Update Notification */
.pwa-update-notification {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0;
    border-radius: 12px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-update-notification.show {
    top: 20px;
}

.pwa-update-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.pwa-update-content span {
    font-size: 0.9rem;
}

.pwa-update-content button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.pwa-update-content button:hover {
    background: #5a6fd6;
}

.pwa-update-content button.dismiss {
    background: transparent;
    color: #94a3b8;
    padding: 8px 12px;
}

.pwa-update-content button.dismiss:hover {
    color: white;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: white;
    padding: 10px 20px;
    border-radius: 0 0 10px 10px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.offline-indicator.show {
    top: 0;
}

.offline-indicator svg {
    width: 18px;
    height: 18px;
}

/* Sync Indicator (for sidebar) */
#sync-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #64748b;
    transition: all 0.3s;
}

#sync-indicator.syncing {
    color: #667eea;
}

#sync-indicator.offline {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

#sync-indicator i {
    font-size: 1rem;
}

/* Sync Badge */
#sync-badge {
    display: none;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* PWA Status in Settings */
.pwa-status-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.pwa-status-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.pwa-status-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.pwa-status-icon i {
    font-size: 1.5rem;
}

.pwa-status-info h4 {
    margin: 0 0 4px 0;
    color: #1e293b;
    font-size: 1.1rem;
}

.pwa-status-info p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.pwa-status-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.pwa-detail-item {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.pwa-detail-item label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.pwa-detail-item span {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 500;
}

.pwa-detail-item span.online {
    color: #22c55e;
}

.pwa-detail-item span.offline {
    color: #f59e0b;
}

/* Cache Info */
.cache-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 15px;
}

.cache-info .cache-size {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.cache-info .cache-label {
    font-size: 0.85rem;
    color: #64748b;
}

.cache-info button {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.cache-info button:hover {
    background: #dc2626;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pwa-banner-content {
        flex-wrap: wrap;
        padding: 12px 15px;
    }

    .pwa-banner-icon {
        width: 40px;
        height: 40px;
    }

    .pwa-banner-icon svg {
        width: 22px;
        height: 22px;
    }

    .pwa-banner-text {
        flex: 1;
        min-width: 0;
    }

    .pwa-banner-text strong {
        font-size: 0.95rem;
    }

    .pwa-banner-text span {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pwa-install-btn {
        padding: 8px 18px;
        font-size: 0.9rem;
    }

    .pwa-update-notification {
        left: 10px;
        right: 10px;
        transform: none;
        border-radius: 12px;
    }

    .pwa-update-content {
        flex-wrap: wrap;
        justify-content: center;
    }

    .offline-indicator {
        left: 10px;
        right: 10px;
        transform: none;
        border-radius: 0 0 10px 10px;
        justify-content: center;
    }

    .pwa-status-details {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .pwa-banner-content {
        padding: 12px;
        gap: 10px;
    }

    .pwa-banner-icon {
        display: none;
    }

    .pwa-status-details {
        grid-template-columns: 1fr;
    }
}

/* iOS Install Instructions Modal */
.ios-install-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ios-install-modal.show {
    display: flex;
}

.ios-install-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.ios-install-content h3 {
    margin: 0 0 20px;
    color: #1e293b;
    font-size: 1.3rem;
}

.ios-install-steps {
    text-align: left;
    margin: 20px 0;
}

.ios-install-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.ios-install-step .step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ios-install-step .step-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

.ios-install-step .step-text strong {
    color: #1e293b;
}

.ios-install-content button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

.ios-install-content button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.syncing-pulse {
    animation: pulse 1.5s infinite;
}
