@import url('https://fonts.googleapis.com/css2?family=Padauk:wght@400;700&family=Plus+Jakarta+Sans:wght@500;700;800&display=swap');

:root {
    --bg-dark: #090d16;
    --card-bg: rgba(30, 41, 59, 0.65);
    --border-subtle: rgba(148, 163, 184, 0.15);
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.45);
    --accent: #fbbf24;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0; padding: 0;
    font-family: 'Plus Jakarta Sans', 'Padauk', sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.18), transparent 60%);
    color: var(--text-main);
    padding-bottom: 110px;
    min-height: 100vh;
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 10px;
    width: 90%; max-width: 360px; pointer-events: none;
}
.toast {
    background: rgba(15, 23, 42, 0.95); color: white;
    padding: 12px 18px; border-radius: 12px; font-weight: bold; font-size: 0.9rem;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); border: 1px solid rgba(56, 189, 248, 0.4);
    backdrop-filter: blur(10px); animation: slideDown 0.25s ease;
}
.toast-success i { color: #10b981; font-size: 1.1rem; }
.toast-error { border-color: rgba(239, 68, 68, 0.5); }
.toast-error i { color: #ef4444; font-size: 1.1rem; }
.toast.fade-out { opacity: 0; transform: translateY(-10px); transition: 0.3s; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-15px); } to { opacity: 1; transform: translateY(0); } }

/* --- Hero Header --- */
.hero-header {
    text-align: center; padding: 32px 20px 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(9, 13, 22, 0.95)), url('/static/shop_bg.jpg');
    background-size: cover; background-position: center;
    border-bottom: 1px solid var(--border-subtle);
}
.hero-badge {
    display: inline-block; background: rgba(59, 130, 246, 0.15); color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3); padding: 4px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: bold; margin-bottom: 10px;
}
.hero-header h1 {
    margin: 0; font-size: 2.1rem; font-weight: 800; letter-spacing: 0.5px;
    color: #ffffff; text-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
}
.hero-header h1 span { color: var(--accent); }
.hero-header p { margin: 8px auto 16px; color: #cbd5e1; font-size: 0.9rem; max-width: 460px; }

/* Payment Copy Bar */
.payment-bar {
    display: inline-flex; align-items: center; justify-content: space-between;
    gap: 12px; background: rgba(30, 41, 59, 0.85); padding: 8px 14px;
    border-radius: 12px; border: 1px solid rgba(251, 191, 36, 0.3);
    max-width: 100%; flex-wrap: wrap;
}
.pay-item { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.pay-badge { padding: 2px 7px; border-radius: 5px; font-size: 0.7rem; font-weight: bold; }
.pay-badge.kpay { background: #0284c7; color: white; }
.pay-badge.wave { background: #eab308; color: #0f172a; }
.copy-btn {
    background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 5px 10px; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 0.78rem;
    transition: 0.2s;
}
.copy-btn:active { transform: scale(0.95); }

/* --- Broadcast Banner --- */
.broadcast-container {
    max-width: 960px; margin: 14px auto; width: calc(100% - 24px);
    background: rgba(30, 41, 59, 0.6); padding: 10px 14px; border-radius: 10px;
    display: flex; align-items: center; border: 1px solid var(--border-subtle);
}
.broadcast-icon { color: var(--accent); margin-right: 12px; font-size: 1rem; }
.scrolling-wrapper { flex-grow: 1; overflow: hidden; white-space: nowrap; }
.scrolling-text {
    display: inline-block; color: #e2e8f0; font-size: 0.88rem;
    animation: scrollText 18s linear infinite;
}
@keyframes scrollText { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* --- Filter Tabs --- */
.filters-wrapper { position: sticky; top: 0; z-index: 90; background: rgba(9, 13, 22, 0.85); backdrop-filter: blur(12px); padding: 10px 0; }
.filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; max-width: 960px; margin: 0 auto; padding: 0 12px; }
.filter-btn {
    background: rgba(30, 41, 59, 0.8); color: var(--text-muted);
    border: 1px solid var(--border-subtle); border-radius: 20px;
    padding: 7px 16px; cursor: pointer; font-weight: 700; font-size: 0.85rem; transition: 0.2s;
}
.filter-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
    border-color: #60a5fa; box-shadow: 0 4px 12px var(--primary-glow);
}

/* --- Products Grid --- */
.main-container { max-width: 960px; margin: 16px auto; padding: 0 12px; }
.grid-container {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px;
}
.product-card {
    background: var(--card-bg); border-radius: 16px; padding: 14px;
    position: relative; border: 1px solid var(--border-subtle);
    display: flex; flex-direction: column; justify-content: space-between;
    backdrop-filter: blur(8px); transition: transform 0.2s, border-color 0.2s;
}
.product-card:hover { transform: translateY(-3px); border-color: rgba(56, 189, 248, 0.45); }
.op-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.op-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.op-badge { font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 12px; border: 1px solid; }
.tag {
    position: absolute; top: -6px; right: 10px; background: #ef4444; color: white;
    font-size: 0.65rem; padding: 2px 8px; border-radius: 6px; font-weight: bold;
}
.tag-best { background: #10b981; }
.tag-value { background: #8b5cf6; }
.package-name { font-weight: 700; font-size: 0.95rem; color: #f8fafc; margin-bottom: 6px; line-height: 1.35; }
.package-note { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.price { font-weight: 800; font-size: 1.15rem; margin: 8px 0 10px; }
.buy-btn {
    width: 100%; background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
    border: none; padding: 10px; border-radius: 10px; font-weight: 700; cursor: pointer;
    font-size: 0.85rem; display: flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); transition: 0.2s;
}
.buy-btn:active { transform: scale(0.97); }

/* --- Floating Buttons --- */
.fab-group { position: fixed; bottom: 20px; right: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 950; }
.fab-btn {
    border: none; color: white; padding: 11px 16px; border-radius: 30px; cursor: pointer;
    font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.track-fab { background: linear-gradient(135deg, #f59e0b, #d97706); }
.chat-fab { background: linear-gradient(135deg, #2563eb, #1d4ed8); }

/* --- Modals --- */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.78);
    z-index: 1100; justify-content: center; align-items: center; backdrop-filter: blur(5px); padding: 16px;
}
.modal-box {
    background: #1e293b; padding: 24px 20px; border-radius: 18px; width: 100%; max-width: 360px;
    text-align: center; position: relative; border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}
.modal-icon-header {
    width: 48px; height: 48px; border-radius: 50%; background: rgba(59, 130, 246, 0.15);
    color: #38bdf8; display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin: 0 auto 12px;
}
.close-modal-btn {
    position: absolute; top: 14px; right: 16px; background: rgba(255,255,255,0.08);
    border: none; color: #cbd5e1; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
}
.selected-pkg-Summary {
    background: #0f172a; padding: 12px; border-radius: 12px; margin: 12px 0 16px;
    border: 1px solid #334155;
}
.summary-op { font-size: 0.75rem; font-weight: 800; }
.summary-name { font-size: 1rem; font-weight: bold; margin: 4px 0; }
.summary-price { font-size: 1.15rem; font-weight: 800; color: var(--accent); }
.input-label { display: block; text-align: left; font-size: 0.8rem; color: #cbd5e1; margin-bottom: 6px; }
#buyPhoneInput, #trackInput {
    width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #475569;
    background: #0f172a; color: white; font-size: 1rem; margin-bottom: 14px; outline: none; text-align: center;
}
#buyPhoneInput:focus, #trackInput:focus { border-color: #38bdf8; }
.primary-submit-btn {
    width: 100%; padding: 12px; background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white; border: none; border-radius: 10px; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.track-result-box { margin-top: 14px; display: none; background: #0f172a; padding: 14px; border-radius: 10px; text-align: left; border: 1px solid #334155; }
.track-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.88rem; }
.track-status { margin-top: 10px; padding: 8px; border-radius: 8px; border: 1px solid; text-align: center; font-weight: bold; }

/* --- Live Chat Box --- */
.chat-box {
    display: none; position: fixed; bottom: 16px; right: 16px;
    width: calc(100% - 32px); max-width: 360px; background: #1e293b; border-radius: 16px;
    flex-direction: column; box-shadow: 0 15px 35px rgba(0,0,0,0.75);
    z-index: 1050; overflow: hidden; border: 1px solid rgba(59, 130, 246, 0.4);
}
.chat-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8); padding: 12px 14px; color: white;
    display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.9rem;
}
.chat-header-info { display: flex; align-items: center; gap: 8px; }
.online-dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 8px #22c55e; }
.chat-header-actions button { background: none; border: none; color: white; font-size: 1rem; cursor: pointer; margin-left: 8px; opacity: 0.9; }
.chat-body { height: 320px; padding: 12px; overflow-y: auto; background: #0b1120; }
.chat-messages { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.msg-system {
    align-self: center; background: rgba(251, 191, 36, 0.12); color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.25); font-size: 0.78rem; padding: 8px 12px;
    border-radius: 10px; text-align: center; width: 95%;
}
.msg-customer {
    background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white;
    padding: 9px 13px; border-radius: 14px 14px 2px 14px; align-self: flex-end;
    max-width: 82%; font-size: 0.88rem; white-space: pre-wrap; word-break: break-word;
}
.msg-admin {
    background: #1e293b; color: #f1f5f9; border: 1px solid #334155;
    padding: 9px 13px; border-radius: 14px 14px 14px 2px; align-self: flex-start;
    max-width: 82%; font-size: 0.88rem; white-space: pre-wrap; word-break: break-word;
}
.chat-img { max-width: 190px; max-height: 230px; border-radius: 10px; display: block; cursor: pointer; object-fit: cover; }
.img-caption { margin-top: 6px; font-size: 0.84rem; }
.chat-input-area { display: flex; align-items: center; padding: 10px; background: #1e293b; border-top: 1px solid #334155; }
.img-upload-label {
    cursor: pointer; width: 38px; height: 38px; border-radius: 50%;
    background: rgba(56, 189, 248, 0.12); color: #38bdf8;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
#myMessage {
    flex-grow: 1; padding: 10px 14px; border-radius: 20px; border: 1px solid #334155;
    background: #0f172a; color: white; margin: 0 8px; outline: none; font-size: 0.88rem;
}
.chat-send-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
    border: none; border-radius: 50%; width: 38px; height: 38px; cursor: pointer; flex-shrink: 0;
}
.chat-box.minimized .chat-body, .chat-box.minimized .chat-input-area { display: none !important; }

/* Lightbox */
#img-lightbox { z-index: 2000; }
#lightbox-img { max-width: 92%; max-height: 85vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); }
.close-lightbox { position: absolute; top: 20px; right: 25px; color: white; font-size: 2.2rem; cursor: pointer; }
