/**
 * PWA Install Prompt - Premium Styling
 * Beautiful floating install banner with coffee theme
 */

/* ========================================
   Install Banner Container
   ======================================== */
.pwa-install-banner {
    position: fixed;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    z-index: 99999;
    transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.pwa-install-banner.show {
    bottom: 24px;
    pointer-events: auto;
}

/* ========================================
   Banner Card Design
   ======================================== */
.pwa-install-card {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 24px;
    padding: 24px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(201, 162, 39, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

/* Decorative coffee steam */
.pwa-install-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatSteam 4s ease-in-out infinite;
}

.pwa-install-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatSteam 5s ease-in-out infinite reverse;
}

@keyframes floatSteam {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.8;
    }
}

/* ========================================
   Banner Header
   ======================================== */
.pwa-install-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.pwa-install-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, #c9a227 0%, #8b6914 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.3);
    flex-shrink: 0;
    overflow: hidden;
}

.pwa-install-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-install-icon i {
    font-size: 28px;
    color: white;
}

.pwa-install-info {
    flex: 1;
    min-width: 0;
}

.pwa-install-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-install-title .verified-badge {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-install-title .verified-badge i {
    font-size: 10px;
    color: white;
}

.pwa-install-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* Close button */
.pwa-install-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.pwa-install-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

/* ========================================
   Features List
   ======================================== */
.pwa-install-features {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.pwa-feature {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
}

.pwa-feature-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.pwa-feature-icon.offline {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.pwa-feature-icon.fast {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.pwa-feature-icon.notify {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: white;
}

.pwa-feature-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* ========================================
   Action Buttons
   ======================================== */
.pwa-install-actions {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.pwa-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pwa-btn-install {
    background: linear-gradient(135deg, #c9a227 0%, #a78419 100%);
    color: #1a1a2e;
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.3);
}

.pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(201, 162, 39, 0.4);
}

.pwa-btn-install:active {
    transform: translateY(0);
}

.pwa-btn-later {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pwa-btn-later:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ========================================
   iOS Install Instructions
   ======================================== */
.pwa-ios-instructions {
    display: none;
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.pwa-ios-instructions.show {
    display: block;
}

.pwa-ios-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.pwa-ios-step:last-child {
    margin-bottom: 0;
}

.pwa-ios-step i {
    color: #c9a227;
}

/* ========================================
   Installed Badge (shown after install)
   ======================================== */
.pwa-installed-badge {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    z-index: 99999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-installed-badge.show {
    transform: translateY(0);
    opacity: 1;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 480px) {
    .pwa-install-banner {
        width: calc(100% - 24px);
        bottom: -250px;
    }

    .pwa-install-banner.show {
        bottom: 16px;
    }

    .pwa-install-card {
        padding: 20px;
        border-radius: 20px;
    }

    .pwa-install-icon {
        width: 52px;
        height: 52px;
    }

    .pwa-install-title {
        font-size: 1.05rem;
    }

    .pwa-install-features {
        gap: 8px;
        padding: 10px;
    }

    .pwa-feature-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .pwa-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .pwa-install-card {
    background: linear-gradient(145deg, #0f0f1a 0%, #1a1a2e 100%);
}

/* ========================================
   Footer Install Section
   ======================================== */
.footer-install-section {
    background: linear-gradient(135deg, #c9a227 0%, #a78419 100%);
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-install-section .install-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-install-section .install-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-install-section .install-icon {
    font-size: 2rem;
    color: #1a1a2e;
    animation: phoneBounce 2s ease-in-out infinite;
}

@keyframes phoneBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.footer-install-section .install-text {
    color: #1a1a2e;
}

.footer-install-section .install-text strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.footer-install-section .install-text span {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-install-section .btn-install-app {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #1a1a2e;
    color: #c9a227;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.footer-install-section .btn-install-app:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #0f0f1a;
}

.footer-install-section .btn-install-app i {
    font-size: 1.1rem;
}

/* iOS Safari - show tap instructions instead */
.footer-install-section.ios .btn-install-app {
    display: none;
}

.footer-install-section .ios-install-hint {
    display: none;
    color: #1a1a2e;
    font-size: 0.9rem;
}

.footer-install-section.ios .ios-install-hint {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 576px) {
    .footer-install-section .install-cta {
        flex-direction: column;
        text-align: center;
    }

    .footer-install-section .install-content {
        flex-direction: column;
    }

    .footer-install-section .btn-install-app {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Navbar Install Button
   ======================================== */
.navbar-install-btn {
    position: relative;
    color: #c9a227 !important;
    border: 2px solid #c9a227 !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    /* display is controlled by JavaScript - do NOT use !important here */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: installPulse 2s ease-in-out infinite;
}

.navbar-install-btn:hover {
    background: #c9a227 !important;
    color: #1a1a2e !important;
    transform: scale(1.1);
    animation: none;
}

.navbar-install-btn i {
    font-size: 1.1rem;
}

@keyframes installPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(201, 162, 39, 0);
    }
}

/* Admin navbar specific */
.admin-topbar .navbar-install-btn {
    width: 36px;
    height: 36px;
}

.admin-topbar .navbar-install-btn i {
    font-size: 1rem;
}