/* Premium Design Stylesheet for KhelBro Webapp */

/* Import Poppins Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-font: 'Poppins', sans-serif;
    --bg-dark: #0f172a;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --custom-red: #ff494e;
    --custom-blue: #3b82f6;
    --custom-green: #22c55e;
    --gradient-btn: linear-gradient(135deg, #e1d729 0%, #84e632 100%);
    --gradient-wallet: linear-gradient(135deg, #79e833 0%, #528631 100%);
    --border-color: #e2e8f0;
    --battle-green-border: #89e531;
    --battle-green-bg: rgba(138, 229, 49, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--primary-font);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

/* App Container Layout */
.app-layout {
    display: flex;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Mobile viewport container */
.app-container {
    width: 100%;
    max-width: 480px;
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
}

/* Sidebar Part (Desktop Only) */
.sidebar-part {
    flex: 1;
    background: url('../images/bg-image.webp') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
}

.sidebar-part::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
}

.sidebar-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: #ffffff;
}

.sidebar-logo {
    width: 260px;
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.sidebar-text {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.6;
}

.sidebar-text span {
    color: var(--custom-red);
    font-weight: 700;
}

.sidebar-chrome {
    display: inline-flex;
    align-items: center;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
}

.sidebar-chrome img {
    width: 20px;
    height: 20px;
    margin: 0 8px;
}

/* Header & Navbar */
.app-header {
    background-color: #1e293b;
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.5rem;
}

.brand-logo {
    height: 35px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.wallet-badge:hover {
    background: rgba(255, 255, 255, 0.18);
}

.wallet-amount {
    font-weight: 600;
    font-size: 0.95rem;
}

.coin-icon {
    width: 18px;
    height: 18px;
}

/* Main Content Wrapper */
.content-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #fafafa;
}

/* Marquee / Announcement */
.announcement-container {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 20px;
    overflow: hidden;
    white-space: nowrap;
    border-left: 4px solid var(--custom-red);
}

.announcement-text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

@keyframes marquee {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Cards & Sections */
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.game-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.game-img {
    width: 100%;
    max-height: 110px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 12px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.game-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
}

.live-badge {
    background: var(--custom-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.coming-soon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

/* Battle Card Styling */
.battle-card {
    border: 1px solid var(--battle-green-border);
    background-color: var(--battle-green-bg);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(137, 229, 49, 0.3);
}

.battle-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e2e8f0;
}

.battle-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
}

.battle-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vs-logo {
    width: 36px;
    height: auto;
}

.battle-amount {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #475569;
}

.input-wrapper {
    display: flex;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #64748b;
}

.input-prefix {
    background: #f1f5f9;
    padding: 12px;
    font-weight: 600;
    color: #475569;
    border-right: 1px solid #cbd5e1;
}

.input-field {
    flex: 1;
    border: none;
    padding: 12px;
    font-size: 1rem;
    outline: none;
    width: 100%;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-btn);
    color: #000000;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(132, 230, 50, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-danger {
    background-color: var(--custom-red);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-danger:hover {
    background-color: #e12d32;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid #000000;
    color: #000000;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

.btn-action {
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
}

.btn-action.play {
    background: var(--gradient-btn);
    color: #000;
}

.btn-action.cancel {
    background-color: var(--custom-red);
    color: #fff;
}

.btn-action.request {
    background-color: var(--custom-blue);
    color: #fff;
}

.btn-action.view {
    background-color: #22c55e;
    color: #fff;
}

/* Wallet Card Layout */
.wallet-card {
    background: var(--gradient-wallet);
    border-radius: 16px;
    padding: 20px;
    color: white;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(82, 134, 49, 0.3);
}

.wallet-balance-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.wallet-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.wallet-card-desc {
    font-size: 0.75rem;
    opacity: 0.85;
    line-height: 1.5;
}

.wallet-card-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 16px;
}

/* Video Responsive */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Navigation Drawer */
.nav-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #1e293b;
    z-index: 200;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
    transition: left 0.3s ease;
    color: white;
    display: flex;
    flex-direction: column;
}

.nav-drawer.active {
    left: 0;
}

.drawer-header {
    padding: 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-user-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.drawer-user-mobile {
    font-size: 0.85rem;
    color: #94a3b8;
}

.drawer-menu {
    flex: 1;
    list-style: none;
    padding: 16px 0;
}

.drawer-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.drawer-item a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
}

.drawer-overlay.active {
    display: block;
}

/* Toast Messages */
.toast-msg {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #334155;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Mobile frames responsiveness */
@media (max-width: 640px) {
    .sidebar-part {
        display: none !important;
    }
}
@media (min-width: 641px) {
    body {
        background-color: var(--bg-dark);
    }
}
.help-banner {
    background: linear-gradient(90deg, #050503 0%, #79e833 100%);
    border-radius: 12px;
    padding: 16px;
    color: white;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.help-banner-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.help-banner-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    text-transform: uppercase;
}
.help-banner-badge {
    background: red;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
}
.help-banner-btn {
    background: #ff494e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}
