/**
 * PWA Stylesheet for Tống Trân (chatluongtot & default themes)
 */

/* ==========================================================================
   1. BOTTOM-RIGHT FLOATING POPUP (WIDGET CÀI ĐẶT NHANH GÓC PHẢI DƯỚI)
   ========================================================================== */
#tt-pwa-bottom-popup {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(139, 69, 19, 0.12);
    z-index: 999999;
    padding: 16px 18px;
    box-sizing: border-box;
    transform: translateY(140%) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #2c2c2c;
}

#tt-pwa-bottom-popup.tt-pwa-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.tt-pwa-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tt-pwa-popup-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tt-pwa-popup-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(139, 69, 19, 0.2);
    border: 1.5px solid #d4af37;
    flex-shrink: 0;
}

.tt-pwa-popup-title-wrap h4 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: #8b4513;
    line-height: 1.3;
}

.tt-pwa-popup-badge {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37, #aa7c11);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.tt-pwa-popup-close {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    color: #666;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.tt-pwa-popup-close:hover {
    background: #ff4757;
    color: #fff;
    transform: rotate(90deg);
}

.tt-pwa-popup-desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: #4b4b4b;
    margin-bottom: 14px;
}

.tt-pwa-popup-desc strong {
    color: #8b4513;
}

.tt-pwa-popup-actions {
    display: flex;
    gap: 8px;
}

.tt-pwa-btn-install-quick {
    flex: 1;
    background: linear-gradient(135deg, #8b4513 0%, #b33939 100%);
    color: #fff !important;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.35);
    transition: all 0.25s ease;
}

.tt-pwa-btn-install-quick:hover {
    background: linear-gradient(135deg, #a35318 0%, #c44040 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.45);
}

.tt-pwa-btn-guide-quick {
    background: #f1f2f6;
    color: #333 !important;
    border: 1px solid #dcdde1;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tt-pwa-btn-guide-quick:hover {
    background: #e4e7eb;
    color: #000 !important;
}

/* ==========================================================================
   2. FOOTER MENU PWA CARD & BUTTON (KHỐI PWA Ở FOOTER MENU)
   ========================================================================== */
.tt-pwa-footer-box {
    background: linear-gradient(135deg, #24140a 0%, #3e200f 60%, #5a2e12 100%);
    border: 1px solid #7d441e;
    border-radius: 16px;
    padding: 24px 28px;
    margin: 25px 0;
    color: #f5e6d8;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

.tt-pwa-footer-box::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

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

.tt-pwa-footer-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1 1 550px;
}

.tt-pwa-footer-logo {
    width: 75px;
    height: 75px;
    border-radius: 18px;
    border: 2px solid #d4af37;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    flex-shrink: 0;
    background: #fff;
}

.tt-pwa-footer-info h3 {
    margin: 0 0 6px 0;
    font-size: 19px;
    font-weight: 700;
    color: #f1c40f;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tt-pwa-footer-info p {
    margin: 0 0 10px 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #e0d0c1;
}

.tt-pwa-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tt-pwa-badge-item {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tt-pwa-footer-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.btn-pwa-footer-main {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #1a0f05 !important;
    font-weight: 800;
    font-size: 14.5px;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.btn-pwa-footer-main:hover {
    background: linear-gradient(135deg, #f1c40f 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.6);
    color: #000 !important;
}

.btn-pwa-footer-sub {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
    font-weight: 600;
    font-size: 13px;
    padding: 9px 18px;
    border-radius: 10px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-pwa-footer-sub:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   3. INSTALL GUIDE MODAL (POPUP HƯỚNG DẪN CÀI ĐẶT ĐA THIẾT BỊ)
   ========================================================================== */
#tt-pwa-install-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#tt-pwa-install-modal.active {
    opacity: 1;
}

.tt-pwa-modal-box {
    background: #ffffff;
    width: 600px;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: ttModalSlideUp 0.3s ease;
}

@keyframes ttModalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.tt-pwa-modal-header {
    background: linear-gradient(135deg, #8b4513 0%, #5a2e12 100%);
    color: #fff;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tt-pwa-modal-header h3 {
    margin: 0;
    font-size: 17.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.tt-pwa-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.tt-pwa-modal-close:hover {
    background: #ff4757;
}

.tt-pwa-tabs-nav {
    display: flex;
    background: #f1f2f6;
    border-bottom: 1px solid #e1e2e6;
}

.tt-pwa-tab-btn {
    flex: 1;
    padding: 12px 10px;
    border: none;
    background: transparent;
    font-size: 13.5px;
    font-weight: 600;
    color: #57606f;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 3px solid transparent;
}

.tt-pwa-tab-btn.active {
    color: #8b4513;
    background: #fff;
    border-bottom-color: #8b4513;
    font-weight: 700;
}

.tt-pwa-modal-body {
    padding: 22px;
    overflow-y: auto;
    max-height: 60vh;
}

.tt-pwa-tab-content {
    display: none;
}

.tt-pwa-tab-content.active {
    display: block;
}

.tt-pwa-step-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tt-pwa-step-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #f8f9fa;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.tt-pwa-step-num {
    background: #8b4513;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.tt-pwa-step-text {
    font-size: 13.5px;
    line-height: 1.55;
    color: #333;
}

.tt-pwa-step-text strong {
    color: #8b4513;
}

.tt-pwa-step-icon {
    display: inline-block;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin: 0 2px;
}

.tt-pwa-modal-footer {
    padding: 14px 22px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tt-pwa-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2ed573;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(46, 213, 115, 0.4);
    font-weight: 600;
    font-size: 14px;
    z-index: 99999999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tt-pwa-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==========================================================================
   4. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 768px) {
    #tt-pwa-bottom-popup {
        bottom: 15px;
        right: 15px;
        left: 15px;
        width: auto;
        max-width: none;
        padding: 14px 15px;
        border-radius: 16px;
    }

    .tt-pwa-footer-box {
        padding: 18px 16px;
        margin: 20px 0;
    }

    .tt-pwa-footer-left {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .tt-pwa-footer-right {
        width: 100%;
    }

    .btn-pwa-footer-main, .btn-pwa-footer-sub {
        width: 100%;
        text-align: center;
    }

    .tt-pwa-badges {
        justify-content: center;
    }
}
