/* PWA Install Toast Styles */
.pwa-install-toast {
    position: fixed;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: calc(100% - 32px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 20px;
    z-index: 10000;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-toast.show {
    bottom: 20px;
}

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

/* Logo styling instead of icon */
.pwa-toast-logo {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pwa-toast-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Keep old icon class for compatibility */
.pwa-toast-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.pwa-toast-text {
    flex: 1;
    min-width: 150px;
}

.pwa-toast-text h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.pwa-toast-text p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.pwa-toast-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
}

.pwa-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.pwa-btn-primary {
    background: #1e293b;
    color: white;
}

.pwa-btn-primary:hover {
    background: #334155;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

.pwa-btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.pwa-btn-secondary:hover {
    background: #e2e8f0;
}

/* Open App Toast - Special styling with success theme */
#pwa-open-app-toast {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 2px solid #10b981;
}

#pwa-open-app-toast .pwa-toast-text h3 {
    color: #059669;
}

#pwa-open-app-toast .pwa-toast-text p {
    color: #047857;
}

#pwa-open-app-toast .pwa-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

#pwa-open-app-toast .pwa-btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Spinner animation for installing message */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .pwa-install-toast {
        bottom: -250px;
        border-radius: 16px 16px 0 0;
        width: 100%;
        left: 0;
        transform: none;
        padding: 24px 20px;
    }

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

    .pwa-toast-content {
        gap: 12px;
    }

    .pwa-toast-actions {
        margin-top: 12px;
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 768px) {
    .pwa-install-toast {
        max-width: 400px;
    }
}

/* Animation for icon */
.pwa-toast-icon svg {
    animation: pwa-icon-pulse 2s ease-in-out infinite;
}

@keyframes pwa-icon-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Manual Install Instructions Modal */
.pwa-instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
}

.pwa-instructions-modal.show {
    opacity: 1;
}

.pwa-manual-instructions {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pwa-manual-instructions h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.pwa-manual-instructions ol {
    margin: 0 0 24px 0;
    padding-left: 20px;
    color: #475569;
}

.pwa-manual-instructions li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.pwa-manual-instructions p {
    color: #475569;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.pwa-manual-instructions button {
    width: 100%;
}

/* Success Message */
.pwa-success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
    width: calc(100% - 40px);
}

.pwa-success-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.pwa-success-content svg {
    color: #10b981;
    margin-bottom: 16px;
}

.pwa-success-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.pwa-success-content p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Mobile responsiveness for modals */
@media (max-width: 640px) {
    .pwa-manual-instructions {
        padding: 24px;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
    }

    .pwa-success-message {
        padding: 32px 24px;
    }
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.offline-indicator svg {
    flex-shrink: 0;
}

/* Caching Status Notification */
.caching-status {
    position: fixed;
    top: -80px;
    right: 20px;
    background: white;
    color: #1e293b;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #3b82f6;
}

.caching-status.show {
    top: 20px;
}

.caching-status.success {
    border-left-color: #10b981;
    background: linear-gradient(to right, #f0fdf4 0%, white 20%);
}

.caching-status.error {
    border-left-color: #ef4444;
    background: linear-gradient(to right, #fef2f2 0%, white 20%);
}

.caching-status.info {
    border-left-color: #3b82f6;
    background: linear-gradient(to right, #eff6ff 0%, white 20%);
}

/* Mobile responsiveness for offline indicator */
@media (max-width: 640px) {
    .offline-indicator {
        width: 100%;
        left: 0;
        transform: none;
        border-radius: 0 0 12px 12px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .caching-status {
        right: 10px;
        left: 10px;
        padding: 12px 16px;
        font-size: 13px;
    }
}
