﻿/* ================================================================
   NeuroSchool PWA Styles
   ================================================================ */

/* Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 10000;
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .pwa-install-banner.visible {
        transform: translateY(0);
    }

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

.pwa-install-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

    .pwa-install-text strong {
        font-size: 14px;
        color: #1a1a2e;
    }

    .pwa-install-text small {
        font-size: 12px;
        color: #6c757d;
    }

.pwa-install-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

    .pwa-install-action:hover {
        transform: scale(1.05);
    }

.pwa-install-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

/* Offline Indicator */
.pwa-offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* UX Phase A: solid dark background — white on the old pink gradient was below 3:1 */
    background: #8a1c2b;
    color: white;
    padding: 12px;
    text-align: center;
    z-index: 10001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

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

/* Update Toast */
.pwa-update-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #1a1a2e;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    transition: transform 0.3s ease;
}

    .pwa-update-toast.visible {
        transform: translateX(-50%) translateY(0);
    }

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

.pwa-update-btn {
    background: #4c51bf; /* UX Phase A: 6.5:1 with white (was #667eea, 3.7:1) */
    color: white;
    border: none;
    min-height: 44px;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.pwa-update-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.85;
    min-width: 44px; /* UX Phase A: touch target */
    min-height: 44px;
}

/* Toast Messages */
.pwa-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 10003;
    transform: translateX(150%);
    transition: transform 0.3s ease;
}

    .pwa-toast.visible {
        transform: translateX(0);
    }

.pwa-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-toast-success {
    border-left: 4px solid #28a745;
}

.pwa-toast-warning {
    border-left: 4px solid #ffc107;
}

.pwa-toast-error {
    border-left: 4px solid #dc3545;
}

.pwa-toast-info {
    border-left: 4px solid #17a2b8;
}

/* Standalone Mode Adjustments */
.pwa-installed body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (display-mode: standalone) {
    /* Hide browser-specific elements */
    .browser-only {
        display: none !important;
    }

    /* Adjust for notch */
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
}

/* iOS Specific */
@supports (-webkit-touch-callout: none) {
    .pwa-install-banner {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pwa-install-banner {
        background: #1a1a2e;
        color: white;
    }

    .pwa-install-text strong {
        color: white;
    }

    .pwa-toast {
        background: #1a1a2e;
        color: white;
    }
}

.pwa-install-prompt {
    position: fixed;
    inset: 0;
    z-index: 10004;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-prompt-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.pwa-prompt-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: promptSlideUp 0.3s ease;
}

@keyframes promptSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-prompt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pwa-prompt-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.pwa-prompt-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pwa-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 13px;
}

    .pwa-feature i {
        font-size: 18px;
    }
