/**
 * TPT PWA Public Styles
 * Styles for install prompts, offline indicators, and PWA UI elements
 */

/* Install Banner */
.tpt-pwa-install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tpt-pwa-install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.tpt-pwa-install-icon {
    flex-shrink: 0;
    color: #ffffff;
}

.tpt-pwa-install-text {
    flex: 1;
    min-width: 0;
}

.tpt-pwa-install-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tpt-pwa-install-text span {
    font-size: 14px;
    opacity: 0.9;
}

.tpt-pwa-install-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.tpt-pwa-install-btn,
.tpt-pwa-dismiss-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tpt-pwa-install-btn {
    background: #ffffff;
    color: #007cba;
}

.tpt-pwa-install-btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.tpt-pwa-dismiss-btn {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tpt-pwa-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Offline Indicator */
.tpt-pwa-offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #dc3232;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

.tpt-pwa-offline-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* Update Toast */
.tpt-pwa-update-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #00a32a;
    color: white;
    padding: 16px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 400px;
}

.tpt-pwa-update-toast span {
    font-size: 14px;
    font-weight: 500;
}

.tpt-pwa-update-toast button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tpt-pwa-update-toast button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Toast Notifications */
.tpt-pwa-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #23282d;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    max-width: 400px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tpt-pwa-install-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .tpt-pwa-install-actions {
        justify-content: center;
    }

    .tpt-pwa-install-text {
        text-align: center;
    }

    .tpt-pwa-offline-indicator {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .tpt-pwa-update-toast {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .tpt-pwa-update-toast button {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .tpt-pwa-install-banner {
        padding: 10px 15px;
    }

    .tpt-pwa-install-btn,
    .tpt-pwa-dismiss-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .tpt-pwa-install-text strong {
        font-size: 15px;
    }

    .tpt-pwa-install-text span {
        font-size: 13px;
    }
}

/* Animation Classes */
.tpt-pwa-fade-in {
    animation: tptPwaFadeIn 0.3s ease-out;
}

.tpt-pwa-fade-out {
    animation: tptPwaFadeOut 0.3s ease-out;
}

@keyframes tptPwaFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tptPwaFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Loading States */
.tpt-pwa-loading {
    position: relative;
    pointer-events: none;
}

.tpt-pwa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: tptPwaSpin 1s linear infinite;
}

@keyframes tptPwaSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus States */
.tpt-pwa-install-btn:focus,
.tpt-pwa-dismiss-btn:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .tpt-pwa-install-banner {
        background: #000000;
        border: 2px solid #ffffff;
    }

    .tpt-pwa-offline-indicator {
        background: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }

    .tpt-pwa-update-toast {
        background: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .tpt-pwa-fade-in,
    .tpt-pwa-fade-out {
        animation: none;
    }

    .tpt-pwa-loading::after {
        animation: none;
    }

    .tpt-pwa-install-btn:hover,
    .tpt-pwa-dismiss-btn:hover,
    .tpt-pwa-update-toast button:hover {
        transform: none;
    }
}
