/* 100Games PWA - Main Styles */
/* Dark theme matching website */

:root {
    --primary: #ffd700;
    --primary-dark: #d4af00;
    --secondary: #7c8aff;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --bg-dark: #1a1a1a;
    --bg-darker: #242424;
    --bg-card: #252542;
    --bg-input: #2a2a4a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6c757d;
    --border-color: rgba(255, 215, 0, 0.2);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Safe area for notched devices */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* App Container */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Page Transitions */
.page {
    display: none;
    flex: 1;
    padding-bottom: 70px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--bg-darker), var(--bg-dark));
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.header-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
}

.header-balance .amount {
    color: var(--success);
    font-weight: 700;
    font-size: 16px;
}

.header-back {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--bg-darker), var(--bg-dark));
    display: flex;
    justify-content: space-around;
    padding: 10px 5px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    min-width: 60px;
}

.nav-item i {
    font-size: 22px;
    color: var(--secondary);
    transition: var(--transition);
}

.nav-item.active,
.nav-item:hover {
    color: var(--primary);
}

.nav-item.active i,
.nav-item:hover i {
    color: var(--primary);
    transform: scale(1.1);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin: 10px 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

/* Wallet Card */
.wallet-card {
    background: linear-gradient(135deg, var(--bg-darker), var(--bg-card));
    border: 2px solid var(--primary);
    text-align: center;
    padding: 25px 20px;
}

.wallet-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 5px;
}

.wallet-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.wallet-amount .currency {
    color: var(--primary);
}

.wallet-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 48px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #27ae60);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #c0392b);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
    min-height: 52px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 15px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group .form-control {
    flex: 1;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon .form-control {
    padding-left: 45px;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
}

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.game-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.game-card-body {
    padding: 12px;
    text-align: center;
}

.game-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.game-card-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 15px 10px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.section-link {
    color: var(--secondary);
    font-size: 14px;
    text-decoration: none;
}

/* Lists */
.list-group {
    margin: 0 15px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.list-item:hover {
    border-color: var(--primary);
}

.list-item-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-item-icon i {
    font-size: 20px;
    color: var(--primary);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 15px;
    font-weight: 600;
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.list-item-value {
    text-align: right;
}

.list-item-amount {
    font-size: 15px;
    font-weight: 700;
}

.list-item-amount.positive {
    color: var(--success);
}

.list-item-amount.negative {
    color: var(--danger);
}

.list-item-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin: 15px;
    padding: 5px;
    gap: 5px;
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tab.active {
    background: var(--primary);
    color: #000;
}

/* Timer Display */
.timer-box {
    background: linear-gradient(135deg, #ffd700, #b8860b);
    border-radius: var(--radius);
    padding: 20px;
    margin: 15px;
    text-align: center;
}

.timer-label {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-bottom: 10px;
}

.timer-display {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.timer-digit {
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    min-width: 50px;
}

.timer-sep {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Betting Options */
.bet-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
}

.bet-option {
    padding: 15px 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.bet-option:hover,
.bet-option.selected {
    transform: scale(1.05);
    border-color: #fff;
}

.bet-option.red { background: var(--danger); color: #fff; }
.bet-option.green { background: var(--success); color: #fff; }
.bet-option.violet { background: #9b59b6; color: #fff; }
.bet-option.big { background: var(--warning); color: #000; }
.bet-option.small { background: var(--info); color: #fff; }

.number-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 15px;
}

.number-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.number-btn:hover,
.number-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #000;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 350px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-message {
    flex: 1;
    font-size: 14px;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-card);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state i {
    font-size: 60px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Pull to Refresh */
.pull-indicator {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Login/Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 20px;
    background: linear-gradient(180deg, var(--bg-darker), var(--bg-dark));
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo h1 {
    font-size: 42px;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.auth-logo p {
    color: var(--text-secondary);
    margin-top: 10px;
}

.auth-form {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px 20px;
    border: 1px solid var(--border-color);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Sports Betting */
.sport-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin: 10px 15px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.sport-card:hover {
    border-color: var(--primary);
}

.sport-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.sport-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

.sport-count {
    background: var(--primary);
    color: #000;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
}

.match-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin: 10px 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 12px;
    color: var(--text-secondary);
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.team {
    text-align: center;
    flex: 1;
}

.team-name {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.vs {
    color: var(--text-muted);
    font-size: 12px;
}

.match-odds {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.odd-btn {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.odd-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 215, 0, 0.1);
}

.odd-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
}

.odd-btn.selected .odd-value {
    color: #000;
}

.odd-label {
    font-size: 10px;
    color: var(--text-muted);
}

.odd-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

/* Bet Slip */
.bet-slip {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 2px solid var(--primary);
    padding: 15px;
    transform: translateY(100%);
    transition: var(--transition);
    z-index: 900;
}

.bet-slip.active {
    transform: translateY(0);
}

.bet-slip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bet-slip-count {
    background: var(--primary);
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* Utilities */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-15 { padding: 15px; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Responsive */
@media (min-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .auth-page {
        max-width: 450px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
