/**
 * 越南彩票 Telegram App - 样式文件
 */

/* ============================================
   全局样式
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B6B;
    --primary-dark: #ff5252;
    --secondary-color: #4ECDC4;
    --success-color: #51CF66;
    --warning-color: #FFD93D;
    --danger-color: #FF6B6B;
    --text-color: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 80px;
}

/* ============================================
   Header
   ============================================ */

.header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    flex: 1;
}

.btn-back {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-color);
    line-height: 1;
}

/* ============================================
   User Card
   ============================================ */

.user-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-id {
    font-size: 12px;
    color: var(--text-secondary);
}

.balance-info {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
    border-radius: 12px;
}

.balance-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.balance-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-color);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

.btn-fixed {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 568px;
    margin: 0 auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-icon {
    font-size: 20px;
}

/* ============================================
   Actions Grid
   ============================================ */

.actions-grid {
    margin-bottom: 20px;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

/* ============================================
   Menu Card
   ============================================ */

.menu-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--bg-color);
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: var(--bg-color);
}

.menu-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
}

.menu-text {
    flex: 1;
    font-size: 16px;
}

.menu-arrow {
    font-size: 24px;
    color: var(--text-secondary);
}

/* ============================================
   Card
   ============================================ */

.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--bg-color);
    font-weight: 600;
}

.card-body {
    padding: 16px;
}

/* ============================================
   Bet Type Selector
   ============================================ */

.bet-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-type {
    padding: 16px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-type.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.type-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.type-desc {
    font-size: 12px;
    opacity: 0.8;
}

/* ============================================
   Form Elements
   ============================================ */

.input-group {
    display: flex;
    gap: 8px;
}

.form-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   Numbers List
   ============================================ */

.numbers-list {
    min-height: 100px;
}

.number-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
}

.number-badge {
    font-size: 18px;
    font-weight: 700;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
}

.amount-input {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
}

.currency {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
}

/* ============================================
   Quick Amounts
   ============================================ */

.quick-amounts {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-color);
}

.quick-amounts-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.amount-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.amount-buttons button {
    padding: 10px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.amount-buttons button:active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============================================
   Summary Card
   ============================================ */

.summary-card {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 80px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-row strong {
    font-size: 18px;
}

.text-success {
    color: var(--success-color);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-top: 16px;
    font-size: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .balance-amount {
        font-size: 24px;
    }
}
