/* ==========================================================================
   Bloodline-Pro Premium Theme By TaksilaSolution
   Fonts: Prompt (Body) & Kanit (Headings/Numbers)
   ========================================================================== */

:root {
    --bg-deep: #0a0a0a;
    --bg-surface: rgba(26, 26, 26, 0.65);
    --bg-navbar: rgba(18, 18, 18, 0.8);
    --gold: #D4AF37;
    --gold-glow: rgba(212, 175, 55, 0.25);
    --gold-gradient: linear-gradient(135deg, #F9D423 0%, #FF4E50 100%);
    --red: #B71C1C;
    --red-glow: rgba(183, 28, 28, 0.4);
    --red-gradient: linear-gradient(135deg, #B71C1C 0%, #ff4d4d 100%);
    --green: #00e676;
    --green-gradient: linear-gradient(135deg, #00e676 0%, #00b25c 100%);
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --text-dark: #121212;
    --border-glass: rgba(255, 255, 255, 0.06);
    --sidebar-width: 260px;
}

/* ตั้งค่าพื้นฐานระบบ */
body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Prompt', sans-serif;
    margin: 0;
    padding-top: 60px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ใช้ฟอนต์หนักแน่นสำหรับหัวข้อและตัวเลข */
h1, h2, h3, h4, h5, h6, 
.portfolio-total, .cat-qty, .brand-center, .finance-val {
    font-family: 'Kanit', sans-serif;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Top Navbar (Glassmorphism Effect)
   ========================================================================== */
.top-navbar {
    background-color: var(--bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-glass);
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 26px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}
.menu-toggle-btn:hover { transform: scale(1.05); color: #fff; }

.brand-center {
    color: var(--gold);
    font-weight: 700;
    font-size: 22px;
    text-decoration: none;
    letter-spacing: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.profile-img-top {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile-img-top:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.6);
}

/* ==========================================================================
   Sidebar Navigation Menu
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: #121212;
    position: fixed;
    top: 0; bottom: 0; left: calc(var(--sidebar-width) * -1);
    padding-top: 80px;
    border-right: 1px solid var(--border-glass);
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.sidebar.show { left: 0; box-shadow: 5px 0 25px rgba(0,0,0,0.6); }

.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 25px;
    color: #999;
    text-decoration: none;
    font-size: 15px;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}
.sidebar-menu li a:hover, 
.sidebar-menu li a.active {
    color: var(--text-main);
    background-color: rgba(255,255,255,0.03);
    border-left-color: var(--gold);
}
.sidebar-menu li a.menu-logout { color: #ff4d4d; }
.sidebar-menu li a.menu-logout:hover {
    background-color: rgba(183, 28, 28, 0.08);
    border-left-color: var(--red);
}
.sidebar-menu li a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.sidebar-divider { height: 1px; background-color: var(--border-glass); margin: 15px 25px; }

/* ==========================================================================
   Bottom Navigation (App-Like Actions Bar)
   ========================================================================== */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 65px;
    background-color: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-glass);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #777;
    text-decoration: none;
    font-size: 11px;
    gap: 4px;
    flex: 1;
    transition: color 0.2s;
}
.nav-item.active { color: var(--gold); }
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ปุ่มลงทะเบียนไก่ตรงกลางลอยเด่น */
.nav-item-center {
    position: relative;
    top: -16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 11px;
    flex: 1;
}
.fab-btn {
    background: var(--red-gradient);
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    border: 4px solid var(--bg-deep);
    box-shadow: 0 4px 14px var(--red-glow);
    margin-bottom: 3px;
    transition: all 0.3s ease;
}
.nav-item-center:hover .fab-btn {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 20px var(--gold-glow);
}
.nav-item-center.active .fab-btn { border-color: var(--gold); }
.nav-item-center.active { color: var(--gold); }

/* ==========================================================================
   Main Layout & Beautiful Components (Dashboard Portfolio)
   ========================================================================== */
.main-content-wrapper {
    padding: 25px;
    min-height: 100vh;
    box-sizing: border-box;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media screen and (min-width: 769px) {
    body.sidebar-open .main-content-wrapper { margin-left: var(--sidebar-width); }
}
@media screen and (max-width: 768px) {
    .main-content-wrapper { padding: 15px; padding-bottom: 95px; }
}

/* การ์ดพอร์ตการลงทุนหลัก Soft Shadows + Glow */
.portfolio-card {
    background: linear-gradient(145deg, #181613 0%, #0f0f0f 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 16px;
    padding: 30px 20px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.03);
    position: relative;
}

.portfolio-title {
    color: #777;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.portfolio-total {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 46px;
    font-weight: 700;
    margin: 5px 0 20px 0;
    text-shadow: 0 4px 15px rgba(249, 212, 35, 0.1);
}

.finance-split {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.02);
    padding: 15px 0;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}
.finance-item { flex: 1; text-align: center; }
.finance-label { color: #666; font-size: 12px; display: block; margin-bottom: 4px; }
.finance-val { color: #fff; font-size: 20px; font-weight: 600; }
.finance-val.cash { color: var(--green); }

/* ปุ่มธุรกรรม */
.wallet-actions { display: flex; justify-content: center; gap: 15px; margin-top: 25px; }
.btn-deposit {
    background: var(--green-gradient);
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.25);
}
.btn-deposit:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0, 230, 118, 0.45); }
.btn-withdraw {
    background-color: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
}
.btn-withdraw:hover { background-color: rgba(255,255,255,0.08); color: #fff; transform: translateY(-2px); }

/* การ์ดสถิติประเภทไก่ (Glassmorphism Grid) */
.section-title {
    border-left: 4px solid var(--gold);
    padding-left: 12px;
    color: #fff;
    margin: 30px 0 18px 0;
    font-size: 18px;
    font-weight: 600;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 15px;
}
.cat-card {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 20px 10px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.cat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5), 0 0 15px rgba(212, 175, 55, 0.05);
}
.cat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background-color: var(--gold); border-radius: 14px 14px 0 0;
}
.cat-card.blue::before { background-color: #29b6f6; }
.cat-card.green::before { background-color: var(--green); }
.cat-card.purple::before { background-color: #ab47bc; }
.cat-card.red::before { background-color: var(--red); }

.cat-icon { font-size: 26px; margin-bottom: 6px; display: block; }
.cat-qty { font-size: 26px; font-weight: 600; color: #fff; }
.cat-label { font-size: 12px; color: #777; margin-top: 4px; display: block; }