/* TrackStar PWA — Offline disabled state, toast, install banner */

/* Disabled state for buttons requiring online connectivity */
.ts-offline-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    position: relative;
}

/* Toast notification */
.ts-pwa-toast {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    padding: 14px 24px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.ts-pwa-toast--visible {
    transform: translateY(0);
}

.ts-pwa-toast--warning {
    background: rgba(30, 30, 30, 0.92);
}

.ts-pwa-toast--success {
    background: var(--ts-success, rgba(16, 185, 129, 0.92));
}

.ts-pwa-toast--info {
    background: var(--ts-button, rgba(37, 99, 235, 0.92));
}

/* Install banner — uses admin Style Color directly */
.ts-pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999998;
    background: var(--ts-primary, #2563eb);
    color: #fff;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.ts-pwa-install-banner--visible {
    transform: translateY(0);
}

.ts-pwa-install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
    gap: 16px;
}

.ts-pwa-install-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.ts-pwa-install-text strong {
    font-size: 15px;
}

.ts-pwa-install-text span {
    font-size: 13px;
    opacity: 0.8;
}

.ts-pwa-install-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ts-pwa-install-btn {
    padding: 8px 20px;
    background: var(--ts-button, var(--tsa-button-color, #2563eb));
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ts-pwa-install-btn:hover {
    background: var(--ts-button-hover, #1d4ed8);
}

.ts-pwa-install-dismiss {
    padding: 8px 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

.ts-pwa-install-dismiss:hover {
    color: #fff;
}

@media (max-width: 480px) {
    .ts-pwa-install-content {
        flex-direction: column;
        text-align: center;
    }
    .ts-pwa-install-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Push permission pre-prompt modal (Phase 3) */
.ts-pwa-push-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ts-pwa-push-prompt--visible {
    opacity: 1;
}

.ts-pwa-push-prompt-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ts-pwa-push-prompt--visible .ts-pwa-push-prompt-modal {
    transform: scale(1);
}

.ts-pwa-push-prompt-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--ts-primary, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.ts-pwa-push-prompt-icon svg {
    stroke: #fff;
}

.ts-pwa-push-prompt-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ts-pwa-push-prompt-body {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ts-pwa-push-prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ts-pwa-push-prompt-accept {
    padding: 12px 24px;
    background: var(--ts-primary, #2563eb);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ts-pwa-push-prompt-accept:hover {
    background: var(--ts-primary-hover, #1d4ed8);
}

.ts-pwa-push-prompt-dismiss {
    padding: 10px 24px;
    background: transparent;
    color: #6b7280;
    border: none;
    font-size: 14px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ts-pwa-push-prompt-dismiss:hover {
    color: #374151;
}
