/* PWA Install Prompt Styles */

/* Install Button in Top Navigation */
.pwa-install-btn {
    display: none;
    /* Hidden by default, shown by JS when installable */
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    background: none;
    color: #3e2723;
    border: 2px solid #ffab40;
    border-radius: 9px;
    font-family: "Forum", serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    margin-right: 12px;
    white-space: nowrap;
}

.pwa-install-btn:hover {
    background: #ffab40;
    border-color: #ffab40;
    color: #fafafa;
    transform: none;
    box-shadow: none;
}

.pwa-install-btn:active {
    transform: none;
}

.pwa-install-btn .material-icons {
    font-size: 20px;
}

/* Mobile Install Button */
.pwa-install-mobile {
    display: none;
    position: fixed;
    bottom: 80px;
    /* Above bottom navigation */
    right: 16px;
    z-index: 999;
    padding: 12px 20px;
    background: linear-gradient(135deg, #d84315 0%, #ff6f00 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(216, 67, 21, 0.4);
    animation: pulse-install 2s infinite;
}

@keyframes pulse-install {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(216, 67, 21, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(216, 67, 21, 0.6);
    }
}

.pwa-install-mobile .material-icons {
    font-size: 18px;
    vertical-align: middle;
    margin-right: 6px;
}

/* 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.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.ios-install-modal.active {
    display: flex;
}

.ios-install-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ios-install-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.ios-install-header img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.ios-install-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.ios-install-steps {
    margin-bottom: 20px;
}

.ios-install-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 8px;
}

.ios-install-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #d84315;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.ios-install-step-text {
    flex: 1;
    color: #555;
    line-height: 1.6;
}

.ios-install-step-text strong {
    color: #d84315;
    font-weight: 600;
}

.ios-install-step .material-icons {
    color: #d84315;
    font-size: 20px;
    vertical-align: middle;
}

.ios-install-close {
    width: 100%;
    padding: 12px;
    background: #d84315;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ios-install-close:hover {
    background: #ff6f00;
}

/* Install Success Toast */
.pwa-install-toast {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #4caf50;
    color: white;
    padding: 16px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: slideUpFade 0.3s ease;
}

.pwa-install-toast.active {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-install-toast .material-icons {
    font-size: 24px;
}

/* Offline Indicator */
.offline-indicator {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #ffab40;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.offline-indicator.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Responsive Design */
/* Tablet Mode (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .pwa-install-btn {
        padding: 8px 16px;
        font-size: 14px;
        margin-right: 10px;
    }
}

/* Mobile Mode */
@media (max-width: 768px) {
    .pwa-install-btn {
        display: none !important;
        /* Hide desktop button on mobile */
    }

    .pwa-install-mobile {
        display: none !important;
        /* Hidden on mobile as requested */
    }
}

@media (min-width: 769px) {
    .pwa-install-mobile {
        display: none !important;
        /* Hide mobile button on desktop */
    }
}

/* Update Available Banner */
.pwa-update-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    padding: 16px 20px;
    z-index: 10500;
    /* Above mobile bottom nav (which is typically 1000-10000) */
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.2);
}

.pwa-update-banner.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: slideUp 0.3s ease;
}

.pwa-update-message {
    flex: 1;
    font-weight: 500;
}

.pwa-update-btn {
    padding: 8px 20px;
    background: white;
    color: #2196f3;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

.pwa-update-btn:hover {
    transform: scale(1.05);
}

.pwa-update-dismiss {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    margin-left: 8px;
}

.pwa-update-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile: Position above bottom navigation */
@media (max-width: 768px) {
    .pwa-update-banner {
        bottom: 70px;
        /* Above mobile bottom nav bar */
        border-radius: 12px 12px 0 0;
    }

    .pwa-update-banner.active {
        flex-wrap: wrap;
    }

    .pwa-update-message {
        width: 100%;
        margin-bottom: 8px;
        font-size: 14px;
    }

    .pwa-update-btn {
        padding: 10px 16px;
        font-size: 13px;
        flex: 1;
    }

    .pwa-update-dismiss {
        margin-left: 0;
    }
}