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

/* ==========================================
   ☀️ KUNDUZGI REJIM (Asosiy kiber-tema) 
   ========================================== */
:root {
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1c1e21;
    --text-m: #65676b;
    --blue: #007aff;
    --red: #ff3b30;
    --green: #34c759;
    --orange: #ff9500;
    --purple: #a200ff;
    --cyan: #32ade6;
    --accent: #8b5cf6;
    --line: #e4e6eb;
    --icon-bg: #e5e5ea;
    --bg-rgb: 255, 255, 255;
    --f9: #f9f9f9;
    --story-ring: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --vip-ring: linear-gradient(45deg, #ffd700, #ff8c00);
}

/* ==========================================
   🌙 TUNGI REJIM (Avto-moslashuv) 
   ========================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --card: #1c1c1e;
        --text: #f5f5f7;
        --text-m: #ebebf599;
        --line: #38383a;
        --icon-bg: #2c2c2e;
        --bg-rgb: 28, 28, 30;
        --f9: #2c2c2e;
    }
}

/* UMUMIY QOIDALAR */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; transition: background-color 0.3s ease, color 0.3s ease; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }

/* ASOSIY MOBIL KARKAS — to‘liq kenglik (chat/profil uslubi) */
.app-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    padding-top: 65px;
    padding-bottom: 75px;
    box-shadow: none;
}

/* KIRITISH MAYDONLARI VA TUGMALAR */
.input-box {
    width: 100%; padding: 14px 15px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--bg);
    color: var(--text); font-family: inherit; font-weight: 600; outline: none; margin-bottom: 12px;
    transition: all 0.2s ease;
}
.input-box:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15); }

.btn-blue {
    background: var(--blue); color: #fff; padding: 14px 15px;
    border-radius: 12px; border: none; font-weight: 900;
    width: 100%; cursor: pointer; text-align: center; display: inline-block; font-size: 15px;
    transition: 0.2s ease;
}
.btn-blue:active { transform: scale(0.96); opacity: 0.9; }

/* ==========================================
   🔥 HEADER VA DATCHIKLAR
   ========================================== */
.smart-header {
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 20px; background-color: var(--card); 
    border-bottom: 1px solid var(--line); 
    position: sticky; top: 0; z-index: 1000; 
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.header-logo { font-size: 22px; font-weight: 900; color: var(--text); letter-spacing: -0.5px; }
.header-icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    background-color: var(--icon-bg); display: flex; align-items: center; justify-content: center;
    color: var(--text); font-size: 18px; position: relative; transition: 0.2s;
}
.header-icon-btn:active { transform: scale(0.9); }
.header-badge {
    position: absolute; top: -5px; right: -5px; background-color: var(--red); color: #fff; 
    font-size: 10px; padding: 2px 6px; border-radius: 10px; font-weight: 900; 
    border: 2px solid var(--card); min-width: 18px; text-align: center;
    box-shadow: 0 2px 5px rgba(255,59,48,0.4);
}

/* ==========================================
   📸 AVATAR VA STATUS DATCHIKLARI
   ========================================== */
.avatar-wrapper { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar { border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); flex-shrink: 0; background: var(--f9);}
.ring-story { padding: 3px; background: var(--story-ring); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ring-vip { padding: 3px; background: var(--vip-ring); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ring-none { padding: 3px; background: transparent; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.online-dot-mini {
    position: absolute; bottom: 0px; right: 0px;
    width: 14px; height: 14px; border: 3px solid var(--bg); border-radius: 50%;
    z-index: 5; display: flex; align-items: center; justify-content: center; box-sizing: content-box;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 inherit; transform: scale(1); }
    70% { box-shadow: 0 0 0 4px transparent; transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
}
@keyframes pulseGrn { 0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); } }
@keyframes sysJump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ==========================================
   🏝️ UNIVERSAL KIBER-OROLCHA VA TOAST
   ========================================== */
#kiber-toast-container {
    position: fixed; top: 15px; left: 50%; transform: translateX(-50%);
    z-index: 100000; display: flex; flex-direction: column; gap: 10px;
    width: 90%; max-width: 400px; pointer-events: none;
}
.kiber-toast {
    background: rgba(var(--bg-rgb), 0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--line); border-radius: 16px; padding: 12px 15px;
    display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    pointer-events: auto; animation: toastDrop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    position: relative; overflow: hidden; cursor: pointer; transition: 0.2s;
}
.kiber-toast:active { transform: scale(0.96); }
.kiber-toast.hiding { animation: toastFade 0.3s ease-in forwards; }

@keyframes toastDrop { 0% { opacity: 0; transform: translateY(-30px) scale(0.9); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastFade { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-20px) scale(0.9); } }

.t-icon-box { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; color: #fff;}
.t-content { flex: 1; min-width: 0; }
.t-title { font-size: 13px; font-weight: 900; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.t-text { font-size: 11px; font-weight: 700; color: var(--text-m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-close { color: var(--text-m); font-size: 16px; padding: 5px; cursor: pointer; flex-shrink: 0; transition: 0.2s; }
.t-close:active { color: var(--red); transform: scale(0.8); }

/* Pastdan chiquvchi Orolcha (Tezkor Xabarlar) */
.kiber-island { 
    position: fixed; top: -100px; left: 50%; transform: translateX(-50%); 
    background: var(--text); color: var(--bg); padding: 12px 24px; border-radius: 40px; 
    font-weight: 800; font-size: 14px; z-index: 100000; 
    transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), background-color 0.3s; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; 
    gap: 10px; width: max-content; max-width: 90vw; margin: 0 auto; white-space: normal; text-align: center; line-height: 1.4;
}
.kiber-island.show { top: 40px; }
.kiber-island.success { background: var(--green); color: #fff; }
.kiber-island.error { background: var(--red); color: #fff; }
.kiber-island.warning { background: var(--orange); color: #fff; }
.kiber-island.info { background: var(--blue); color: #fff; }

/* ==========================================
   ⏳ AJAX GLOBAL BOTTOM LOADER
   ========================================== */
.global-bottom-loader {
    display: none; align-items: center; justify-content: center; 
    gap: 8px; padding: 20px; color: var(--text-m); 
    font-size: 13px; font-weight: 800; opacity: 0.7; width: 100%;
}
.global-bottom-loader.active { display: flex; }
.global-bottom-loader i { font-size: 16px; color: var(--blue); }

/* ==========================================
   📱 PASTKI NAV (footer.php)
   ========================================== */
:root {
    --nav-bg: rgba(255, 255, 255, 0.75);
    --nav-border: rgba(0, 0, 0, 0.05);
    --nav-shadow: 0 10px 30px rgba(0,0,0,0.08);
    --nav-active: #000;
}
@media (prefers-color-scheme: dark) {
    :root {
        --nav-bg: rgba(28, 28, 30, 0.75);
        --nav-border: rgba(255, 255, 255, 0.08);
        --nav-shadow: 0 10px 30px rgba(0,0,0,0.5);
        --nav-active: #fff;
    }
}
.kiber-nav {
    position: fixed; bottom: max(15px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
    width: calc(100% - 60px); max-width: 380px; height: 54px;
    background: var(--nav-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--nav-border); border-radius: 27px;
    display: flex; align-items: center; justify-content: space-around;
    padding: 0 8px; z-index: 1000; box-shadow: var(--nav-shadow);
}
.n-item {
    color: var(--text-m); font-size: 18px; display: flex; flex-direction: column; justify-content: center; align-items: center;
    width: 44px; height: 44px; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; position: relative; text-decoration: none;
}
.n-item.active { color: var(--nav-active); transform: translateY(-1px); }
.n-item.active::after { content: ''; position: absolute; bottom: 6px; width: 3px; height: 3px; border-radius: 50%; background: var(--nav-active); }
.n-item:active { transform: scale(0.9); }
.n-add {
    background: var(--nav-active); color: var(--bg); width: 40px; height: 40px; border-radius: 15px;
    display: flex; justify-content: center; align-items: center; font-size: 18px; font-weight: 900; text-decoration: none;
    transition: 0.2s; box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.n-add:active { transform: scale(0.92); }
.n-ava { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1.5px solid transparent; transition: 0.2s; pointer-events: none; }
.n-item.active .n-ava { border-color: var(--nav-active); padding: 1.5px; }
.f-drop-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.f-drop-menu {
    position: absolute; bottom: calc(100% + 15px); right: -5px; background: var(--card); border: 1px solid var(--line);
    border-radius: 18px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); width: 150px; z-index: 9999;
    display: none; flex-direction: column; overflow: hidden; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
}
.f-drop-menu.show { display: flex; animation: popUpNav 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popUpNav { from {opacity:0; transform: translateY(15px) scale(0.9);} to {opacity:1; transform: translateY(0) scale(1);} }
.f-drop-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: var(--text);
    font-size: 14px; font-weight: 800; text-decoration: none; border-bottom: 1px solid var(--line); transition: 0.2s;
}
.f-drop-item:active { background: var(--f9); }
.f-drop-item:last-child { border-bottom: none; }
.f-drop-item.red { color: var(--red); }

/* Toast bot */
.kiber-toast.bot-msg { box-shadow: 0 0 20px rgba(52, 199, 89, 0.3); border: 1px solid rgba(52, 199, 89, 0.5); background: linear-gradient(145deg, var(--card) 60%, rgba(52,199,89,0.05) 100%); }
.bot-title { color: #34c759 !important; font-weight: 900; text-shadow: 0 0 5px rgba(52,199,89,0.4); }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-100%); opacity: 0; } }

/* ==========================================
   📄 SAHIFA LAYOUT
   ========================================== */
.app-main {
    padding: 0 0 100px 0;
    max-width: 100%;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}
.app-main.narrow { max-width: 100%; }
.vibe-card, .k-form-card, .g-card {
    background: var(--card);
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 14px 16px;
    margin: 0 0 0 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.sec-card {
    background: var(--card);
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 14px 16px;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Forma */
.md-input, .auth-input, .g-input, .shop-search {
    width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
    padding: 14px 15px; border-radius: 14px; font-weight: 800; font-size: 14px; outline: none;
    box-sizing: border-box; font-family: inherit; transition: 0.2s;
}
.md-input:focus, .auth-input:focus, .g-input:focus, .shop-search:focus { border-color: var(--blue); }
.md-btn {
    background: linear-gradient(135deg, var(--blue), var(--accent)); color: #fff; border: none;
    padding: 14px 20px; border-radius: 14px; font-weight: 900; font-size: 14px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.2s; text-decoration: none; box-sizing: border-box;
}
.md-btn:active { transform: scale(0.97); opacity: 0.9; }
.md-btn.btn-red, .md-btn.danger { background: var(--red); }
.md-btn.btn-green, .md-btn.primary { background: var(--green); }
.md-btn.btn-orange { background: var(--orange); }
.md-btn.btn-dark { background: var(--f9); color: var(--text); border: 1px solid var(--line); }
.md-btn.btn-purple { background: var(--purple); }

/* Tabs */
.shop-tabs, .p-tabs { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 10px; margin-bottom: 15px; scrollbar-width: none; }
.shop-tabs::-webkit-scrollbar, .p-tabs::-webkit-scrollbar { display: none; }
.s-tab, .p-tab {
    background: var(--card); border: 1px solid var(--line); color: var(--text-m);
    padding: 12px 18px; border-radius: 14px; font-weight: 900; font-size: 13px;
    white-space: nowrap; cursor: pointer; transition: 0.2s; border: none;
}
.s-tab.active, .p-tab.active { background: var(--blue); color: #fff; box-shadow: 0 4px 15px rgba(0,122,255,0.3); }
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Bottom sheet / share */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 9998; backdrop-filter: blur(3px); display: none; }
.bottom-sheet {
    position: fixed; bottom: -100%; left: 50%; transform: translateX(-50%); width: 100%; max-width: 600px;
    background: var(--card); border-radius: 30px 30px 0 0; padding: 20px; z-index: 9999;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1); max-height: 70vh;
    display: flex; flex-direction: column; border-top: 1px solid var(--line); box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
}
.sheet-handle { width: 40px; height: 5px; background: var(--line); border-radius: 10px; margin: 0 auto 15px auto; }
.share-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-radius: 18px; border: 1.5px solid transparent; cursor: pointer; transition: 0.2s; background: var(--bg); }
.share-item.selected { background: rgba(0,122,255,0.08); border-color: var(--blue); }
.share-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: transparent; font-size: 13px; background: var(--card); }
.share-item.selected .share-check { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Shop / grid */
.shop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; background: linear-gradient(135deg, var(--blue), #a200ff); padding: 20px; border-radius: 20px; color: #fff; box-shadow: 0 10px 30px rgba(0,122,255,0.4); position: relative; overflow: hidden; }
.shop-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 15px 20px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; transition: 0.2s; }
.buy-btn { background: var(--blue); color: #fff; border: none; padding: 10px 18px; border-radius: 12px; font-weight: 900; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.buy-btn.owned { background: var(--bg); color: var(--text-m); cursor: default; border: 1px solid var(--line); }
.grid-shop { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 25px; }
.grid-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 15px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* Loader */
#global-loader { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 99999; backdrop-filter: blur(3px); flex-direction: column; justify-content: center; align-items: center; color: #fff; }
.loader-spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.3); border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 10px; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Matn linklar */
.k-tag, .k-mention { color: var(--blue); font-weight: 900; text-decoration: none; }
.k-embed { margin: 10px 0; border-radius: 12px; overflow: hidden; }

/* Header yordam */
.header-back { color: var(--text); font-size: 20px; margin-right: 15px; padding: 5px; }
.page-title { font-size: 19px; font-weight: 900; margin: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
