/* Stake.com Inspired Theme - Core Layout & Dashboard */
:root {
    --stake-bg: #0f212e; /* Sidebar and main background */
    --stake-card: #1a2c38; /* Cards and header */
    --stake-hover: #213743; /* Hover states */
    --stake-primary: #0052ff; /* Wallet Blue */
    --stake-primary-hover: #1b66fd;
    --stake-text: #b1bad3; /* Gray text */
    --stake-text-white: #ffffff; /* White text */
    --stake-border: #213743; /* Dividers */
    --stake-success: #00e701; /* Green wins */
    --stake-success-bg: rgba(0, 231, 1, 0.1);
    --stake-sidebar-width: 260px;
    --stake-sidebar-slim: 60px;
    --stake-glow-blue: 0 0 20px rgba(0, 82, 255, 0.4);
    --stake-glow-green: 0 0 20px rgba(0, 231, 1, 0.3);
    --stake-gradient-primary: linear-gradient(135deg, #0052ff 0%, #1b66fd 100%);
    --stake-glass-bg: rgba(26, 44, 56, 0.6);
    --stake-glass-border: rgba(255, 255, 255, 0.05);
}

body {
    background-color: var(--stake-bg) !important;
    color: var(--stake-text) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    margin: 0;
    overflow-x: hidden;
}

/* -----------------------------
   Layout Architecture
----------------------------- */
.stake-app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.stake-sidebar-wrapper {
    width: var(--stake-sidebar-width);
    background-color: var(--stake-bg);
    border-right: 1px solid var(--stake-border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slim Sidebar State */
.stake-sidebar-wrapper.slim-sidebar {
    width: var(--stake-sidebar-slim);
}

.stake-sidebar-wrapper.slim-sidebar .ms-3,
.stake-sidebar-wrapper.slim-sidebar h6,
.stake-sidebar-wrapper.slim-sidebar .menu-label {
    display: none !important;
}

.stake-sidebar-wrapper.slim-sidebar .stake-nav-item {
    justify-content: center;
    padding: 0;
}

.stake-sidebar-wrapper.slim-sidebar .stake-nav-item i {
    margin-right: 0;
}

.stake-main-wrapper {
    flex-grow: 1;
    margin-left: var(--stake-sidebar-width);
    display: flex;
    flex-direction: column !important;
    min-height: 100vh;
    width: auto; /* Let it fill available space */
    background-color: var(--stake-card);
    overflow-x: hidden;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Adjust margin when sidebar is slim */
.stake-app-layout:has(.stake-sidebar-wrapper.slim-sidebar) .stake-main-wrapper {
    margin-left: var(--stake-sidebar-slim);
}

.stake-content-area {
    padding: 24px 32px;
    background-color: var(--stake-card);
    flex: 1 0 auto;
    width: 100%;
}

.stake-footer {
    flex-shrink: 0;
    width: 100%;
}

/* -----------------------------
   Sidebar
----------------------------- */
.stake-sidebar-logo {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--stake-border);
}

.stake-sidebar-logo img {
    height: 35px;
}

.stake-sidebar-menu {
    padding: 15px 10px;
    flex-grow: 1;
}

.stake-nav-item {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: var(--stake-text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 4px;
}

@media (max-width: 991px) {
    .stake-nav-item {
        justify-content: flex-start;
        padding: 0 20px;
        font-size: 16px;
        height: 52px;
    }
}

.stake-nav-item:hover, .stake-nav-item.active {
    background-color: var(--stake-hover);
    color: white;
}

/* -----------------------------
   Dashboard High-Fidelity (Stake.com style)
----------------------------- */
.stake-featured-hero {
    background-color: var(--stake-card);
    border-radius: 12px;
    overflow: hidden;
    background-image: url('https://stake.com/img/games/casino/dream-princess-bg.jpg');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.stake-pill-btn {
    background: var(--stake-bg);
    color: var(--stake-text);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
}

.stake-pill-btn:hover, .stake-pill-btn.active {
    background: var(--stake-hover);
    color: white;
}

.stake-game-info-bar {
    padding: 8px 5px;
    background: transparent;
}

/* Mobile Bottom Nav */
.stake-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #0f212e;
    border-top: 1px solid #1a2c38;
    z-index: 9999;
    padding: 10px 0;
}

@media (max-width: 991px) {
    .stake-mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    .stake-content-area {
        padding-bottom: 80px; /* Space for bottom nav */
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--stake-text);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    flex: 1;
}

.mobile-nav-item i {
    font-size: 18px;
}

.mobile-nav-item.active {
    color: white;
    position: relative;
}

.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    width: 20px;
    height: 2px;
    background: white;
}

/* Utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.stake-nav-item i {
    width: 24px;
    font-size: 18px;
    margin-right: 12px;
    display: flex;
    justify-content: center;
}

.stake-nav-item:hover, .stake-nav-item.active {
    background-color: var(--stake-hover);
    color: var(--stake-text-white);
}

/* -----------------------------
   Header
----------------------------- */
.stake-header {
    background-color: var(--stake-card);
    padding: 15px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    /* Box shadow to separate from content slightly */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stake-wallet-group {
    display: flex;
    background-color: var(--stake-bg);
    border-radius: 4px;
    overflow: visible;
    height: 40px;
    position: relative;
    z-index: 9999;
}

.stake-balance {
    color: var(--stake-text-white);
    font-weight: 600;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.stake-balance:hover {
    background-color: var(--stake-hover);
}

.stake-wallet-btn {
    background-color: var(--stake-primary);
    color: white !important;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
}

.stake-wallet-btn:hover {
    background-color: var(--stake-primary-hover);
}

.stake-header-icons {
    display: flex;
    gap: 20px;
    align-items: center;
    color: var(--stake-text);
    font-size: 18px;
}

.stake-header-icons i {
    cursor: pointer;
    transition: color 0.2s;
}

.stake-header-icons i:hover {
    color: var(--stake-text-white);
}

/* -----------------------------
   Dashboard UI (High-Fidelity)
----------------------------- */
.stake-top-row {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.stake-vip-card {
    background: linear-gradient(145deg, #1e2c38, #111e29);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.vip-progress-container {
    position: relative;
    padding: 10px 0;
}

.stake-promo-banners {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.promo-banner {
    border-radius: 16px;
    padding: 35px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.promo-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.promo-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.promo-banner:hover::after {
    opacity: 1;
}

.promo-casino {
    background: linear-gradient(135deg, #0037ff 0%, #001977 100%);
    border: 1px solid rgba(0, 55, 255, 0.3);
}

.promo-sports {
    background: linear-gradient(135deg, #1dcc23 0%, #0a5c0d 100%);
    border: 1px solid rgba(29, 204, 35, 0.3);
}

.stake-search-bar {
    background-color: var(--stake-bg);
    border: 1px solid var(--stake-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    margin-bottom: 30px;
    transition: border-color 0.2s;
}

.stake-search-bar:focus-within {
    border-color: var(--stake-primary);
}

.stake-search-bar select, .stake-search-bar input {
    background: transparent;
    border: none;
    color: var(--stake-text-white);
    outline: none;
    font-size: 15px;
}

.stake-search-bar select {
    border-right: 1px solid var(--stake-border);
    padding-right: 20px;
    margin-right: 20px;
    color: var(--stake-text);
    font-weight: 600;
}

/* Glassmorphism Utility */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

/* Games Grid */
.stake-section-title {
    color: var(--stake-text-white);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stake-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 50px;
}

.stake-game-card {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    background-color: var(--stake-card);
}

.game-card-img-wrapper {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 8px;
}

.game-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card-overlay i {
    font-size: 48px;
    color: white;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.stake-game-card:hover {
    transform: translateY(-5px);
}

.stake-game-card:hover .game-card-img-wrapper img {
    transform: scale(1.05);
}

.stake-game-card:hover .game-card-overlay {
    opacity: 1;
}

.stake-game-footer {
    padding: 10px 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--stake-text);
}

.stake-dot-green {
    width: 8px;
    height: 8px;
    background-color: var(--stake-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--stake-success);
}

/* Data Table */
.stake-table-container {
    background-color: transparent;
    width: 100%;
    overflow-x: auto;
}

.stake-table {
    width: 100%;
    border-collapse: collapse;
}

.stake-table th {
    text-align: left;
    padding: 15px 10px;
    color: var(--stake-text);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 1px solid var(--stake-border);
}

.stake-table td {
    padding: 15px 10px;
    color: var(--stake-text-white);
    font-size: 14px;
    border-bottom: 1px solid rgba(33, 55, 67, 0.5); /* subtle border */
}

.stake-table tr:hover td {
    background-color: rgba(33, 55, 67, 0.3);
}

.text-green { color: var(--stake-success) !important; }
.text-hidden { color: var(--stake-text) !important; }

/* Utilities */
.stake-btn-pill {
    background-color: var(--stake-hover);
    color: var(--stake-text-white);
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    margin-right: 10px;
    transition: background 0.2s;
}
.stake-btn-pill.active {
    background-color: var(--stake-border);
}

/* Stake Input Fields */
.stake-input {
    background-color: var(--stake-bg) !important;
    border: 1px solid var(--stake-border) !important;
    color: var(--stake-text-white) !important;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    width: 100%;
}

.stake-input:focus {
    border-color: var(--stake-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 82, 255, 0.2) !important;
}

/* Input addons/icons */
.stake-input-addon {
    background: transparent !important;
    border: none !important;
    color: var(--stake-text) !important;
}

/* Premium Primary Buttons */
.btn--primary {
    background: linear-gradient(135deg, #0052ff, #1b66fd) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 82, 255, 0.4) !important;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 82, 255, 0.6) !important;
}

@media (max-width: 991px) {
    .stake-sidebar-wrapper { 
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: block !important; 
        z-index: 9999 !important;
        background: #0f212e !important;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
        width: 260px !important; /* Wider on mobile for text */
    }
    .stake-sidebar-wrapper.active {
        transform: translateX(0);
    }
    .stake-main-wrapper { 
        margin-left: 0; 
        width: 100%;
        flex-direction: column !important;
    }
    .stake-header { padding: 10px 15px; }
    .stake-content-area { padding: 15px; width: 100%; }
    .stake-top-row { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .stake-wallet-group { height: 36px; margin: 0 5px !important; }
    .stake-balance { padding: 0 8px; font-size: 12px; }
    .stake-balance #activeBalanceAmount { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
    .stake-wallet-btn { padding: 0 10px; font-size: 12px; }
    .stake-header-icons { gap: 10px; }
    .stake-header-icons .fa-user, .stake-header-icons .fa-bell { font-size: 16px; }
    
    .stake-games-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
    
    .ticker-item { padding: 0 15px; gap: 5px; }
    .ticker-item img { width: 16px; height: 16px; }
    .ticker-item .small { font-size: 11px; }

    .stake-featured-hero { min-height: 180px; padding: 15px !important; }
    .stake-featured-hero h4 { font-size: 16px !important; margin-bottom: 5px !important; }
    .stake-featured-hero p { font-size: 11px !important; margin-bottom: 10px !important; }
    .stake-featured-hero .btn { padding: 5px 15px !important; font-size: 11px !important; }

    .glass-card { padding: 15px !important; }
    .glass-card .h5 { font-size: 14px !important; }
    .glass-card .small { font-size: 8px !important; }
    .glass-card i { font-size: 14px !important; }
    .glass-card .bg-primary, .glass-card .bg-info, .glass-card .bg-success, .glass-card .bg-warning {
        width: 35px !important; height: 35px !important; margin-bottom: 10px !important;
    }
}

@media (max-width: 575px) {
    .stake-header { padding: 10px 10px; }
    .stake-wallet-group { flex-grow: 1; max-width: 250px; min-width: 160px; }
    .stake-balance { padding: 0 10px !important; }
    .stake-balance #activeCurrencyIcon { margin: 0; }
    .stake-sidebar-logo { padding: 15px 10px; }
    
    .stake-pill-btn { padding: 8px 15px; font-size: 12px; }
    
    /* Table optimization for very small screens */
    .stake-table th:nth-child(3), .stake-table td:nth-child(3),
    .stake-table th:nth-child(5), .stake-table td:nth-child(5) {
        display: none;
    }
    
    .stake-footer .gap-4 { gap: 1.5rem !important; }
    .stake-footer .gap-3 { gap: 1rem !important; }
    .stake-footer img { max-width: 100%; height: auto; }
}

/* -----------------------------
   Glassmorphism Utilities
----------------------------- */
.glass-panel {
    background: rgba(26, 44, 56, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 12px;
}

.glass-card {
    background: rgba(33, 55, 67, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(33, 55, 67, 0.6);
    transform: translateY(-2px);
}

.glass-btn {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.2s;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 480px) {
    .stake-header-icons .fa-search, 
    .stake-header-icons .fa-comment-alt,
    .stake-header-icons .fa-bell {
        display: none;
    }
    .stake-balance { max-width: none; }
    .stake-balance #activeBalanceAmount {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }
}

/* -----------------------------
   New Premium Utilities
----------------------------- */
.text-glow-primary { text-shadow: 0 0 10px rgba(0, 82, 255, 0.5); }
.text-glow-success { text-shadow: 0 0 10px rgba(0, 231, 1, 0.5); }

.border-glow-primary { border-color: var(--stake-primary) !important; box-shadow: var(--stake-glow-blue); }

.bg-gradient-primary { background: var(--stake-gradient-primary) !important; }

/* Ticker Animation */
@keyframes scrollTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-wrapper {
    display: flex;
    overflow: hidden;
    background: rgba(15, 33, 46, 0.4);
    border-radius: 50px;
    padding: 8px 0;
    border: 1px solid var(--stake-glass-border);
}

.ticker-content {
    display: flex;
    white-space: nowrap;
    animation: scrollTicker 30s linear infinite;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 30px;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.ticker-item img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Badge Enhancements */
.badge-hot {
    background: linear-gradient(90deg, #ff4b2b, #ff416c);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-new {
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

/* Enhanced Table Rows */
.stake-table tbody tr {
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.02) !important;
}
/* Final Mobile Polish */
@media (max-width: 767px) {
    .stake-footer { text-align: center; }
    .stake-footer .row { flex-direction: column !important; }
    .stake-footer .col-lg-3, .stake-footer .col-lg-2, .stake-footer .col-lg-8, .stake-footer .col-md-6 { 
        width: 100% !important; 
        margin-left: 0 !important;
        margin-bottom: 30px;
    }
    
    /* Ensure game banners cover the width */
    .stake-featured-hero {
        background-size: cover !important;
        background-position: center !important;
        min-height: 160px !important;
    }
    
    /* Fix ticker overlap */
    .ticker-content {
        animation-duration: 20s !important;
    }
    
    /* Stats grid on mobile */
    .row.g-3.mb-5 .col-6 {
        width: 50% !important;
    }
}

.stake-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02) !important;
    box-shadow: inset 5px 0 0 var(--stake-primary);
}

.stake-table td {
    border: none !important;
}

/* -----------------------------
   Premium XAXINO Preloader
----------------------------- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0e11;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: all 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.preloader-content {
    display: flex;
    gap: 8px;
}

.loader-letter {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    display: inline-block;
    animation: letter-bounce 1.4s infinite ease-in-out;
    text-shadow: 0 0 20px rgba(0, 82, 255, 0.3);
    letter-spacing: 2px;
}

.loader-letter:nth-child(2) { animation-delay: 0.1s; }
.loader-letter:nth-child(3) { animation-delay: 0.2s; }
.loader-letter:nth-child(4) { animation-delay: 0.3s; }
.loader-letter:nth-child(5) { animation-delay: 0.4s; }
.loader-letter:nth-child(6) { animation-delay: 0.5s; }

@keyframes letter-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
        color: #ffffff;
        text-shadow: 0 0 20px rgba(0, 82, 255, 0.3);
    }
    50% {
        transform: translateY(-25px) scale(1.1);
        color: #0052ff;
        text-shadow: 0 0 35px rgba(0, 82, 255, 0.8);
    }
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
}

@media (max-width: 767px) {
    .loader-letter {
        font-size: 2.2rem;
    }
}
