/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #1a472a;
    color: white;
    text-align: center;
    padding: 10px;
    margin: 0;
    min-height: 100vh;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    background: #0a2a1a;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Header - Responsive */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background: #0a2a1a;
    border-radius: 10px;
}

@media (min-width: 768px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
    }
}

h1 {
    margin: 0;
    color: #ffcc00;
    font-size: 1.5rem;
}

@media (min-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
}

/* User Info - Responsive */
.user-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: #0a2a1a;
    padding: 8px 12px;
    border-radius: 10px;
    width: 100%;
}

@media (min-width: 768px) {
    .user-info {
        width: auto;
        flex-wrap: nowrap;
    }
}

.user-info span {
    font-size: 0.9rem;
}

.balance-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffcc00;
}

/* Buttons in Header */
.deposit-link, .withdraw-link, .admin-link, .refresh-btn, .logout-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
    margin: 0;
    white-space: nowrap;
}

@media (min-width: 480px) {
    .deposit-link, .withdraw-link, .admin-link, .refresh-btn, .logout-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
}

/* Login/Register Sections */
.login-section {
    background: #2d5a3b;
    padding: 20px 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.login-section input {
    display: block;
    width: 90%;
    max-width: 280px;
    margin: 10px auto;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ffcc00;
    border-radius: 5px;
    background: white;
}

@media (min-width: 480px) {
    .login-section input {
        width: 80%;
    }
}

.login-section button {
    background: #ffcc00;
    color: #1a472a;
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

/* Betting Section */
.betting-section {
    background: #2d5a3b;
    padding: 20px 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.bet-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.bet-input {
    padding: 12px;
    font-size: 18px;
    width: 150px;
    text-align: center;
    border: 2px solid #ffcc00;
    border-radius: 5px;
    background: white;
}

@media (min-width: 480px) {
    .bet-input {
        width: 200px;
    }
}

.quick-bets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.quick-bet {
    background: #ffcc00;
    color: #1a472a;
    padding: 6px 12px;
    font-size: 0.8rem;
    margin: 0;
}

@media (min-width: 480px) {
    .quick-bet {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

.bet-btn {
    background: #28a745;
    color: white;
    font-size: 1rem;
    padding: 10px 25px;
}

/* Cards Section */
.hand {
    margin: 20px 0;
    padding: 15px;
    background: #2d5a3b;
    border-radius: 10px;
}

.cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.card {
    background: white;
    color: black;
    width: 60px;
    height: 85px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

@media (min-width: 480px) {
    .card {
        width: 70px;
        height: 100px;
        font-size: 20px;
    }
}

@media (min-width: 768px) {
    .card {
        width: 80px;
        height: 110px;
        font-size: 24px;
    }
}

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

.card.red {
    color: red;
}

.score {
    font-size: 1rem;
    margin-top: 10px;
    font-weight: bold;
}

/* Game Buttons */
.buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

button {
    background: #ffcc00;
    color: #1a472a;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

@media (min-width: 480px) {
    button {
        padding: 12px 24px;
        font-size: 1rem;
        margin: 0 5px;
    }
}

button:hover {
    background: #ffdd44;
    transform: scale(1.02);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

/* Status Message */
.status {
    font-size: 1rem;
    margin: 15px;
    padding: 10px;
    background: #00000088;
    border-radius: 5px;
    font-weight: bold;
}

@media (min-width: 480px) {
    .status {
        font-size: 1.2rem;
    }
}

/* History Sections */
.history-section {
    margin-top: 20px;
    padding: 15px;
    background: #0a2a1a;
    border-radius: 10px;
}

.history-section h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.transaction-list {
    max-height: 250px;
    overflow-y: auto;
    margin: 10px 0;
}

.transaction-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin: 5px 0;
    background: #1a472a;
    border-radius: 5px;
    font-size: 0.7rem;
}

@media (min-width: 480px) {
    .transaction-item {
        font-size: 0.8rem;
        flex-wrap: nowrap;
    }
}

.transaction-item.deposit, .transaction-item.win {
    border-left: 4px solid #28a745;
}

.transaction-item.bet, .transaction-item.loss {
    border-left: 4px solid #dc3545;
}

.amount.positive {
    color: #28a745;
    font-weight: bold;
}

.amount.negative {
    color: #dc3545;
    font-weight: bold;
}

/* Statistics Section */
.stats-section {
    margin-top: 20px;
    padding: 15px;
    background: #0a2a1a;
    border-radius: 10px;
}

.stats-section h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

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

.stat-card {
    background: #1a472a;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: #aaa;
}

@media (min-width: 480px) {
    .stat-label {
        font-size: 0.8rem;
    }
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffcc00;
}

@media (min-width: 480px) {
    .stat-value {
        font-size: 1.5rem;
    }
}

/* Message Styles */
.message {
    margin-top: 10px;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.8rem;
}

.message.success {
    background: #28a745;
    color: white;
}

.message.error {
    background: #dc3545;
    color: white;
}

/* Loading State */
.loading {
    cursor: wait;
    opacity: 0.7;
}

.loading button {
    pointer-events: none;
    opacity: 0.6;
}

/* Scrollbar Styling */
.transaction-list::-webkit-scrollbar {
    width: 6px;
}

.transaction-list::-webkit-scrollbar-track {
    background: #0a2a1a;
    border-radius: 3px;
}

.transaction-list::-webkit-scrollbar-thumb {
    background: #ffcc00;
    border-radius: 3px;
}

/* No History Message */
.no-history {
    text-align: center;
    padding: 15px;
    color: #999;
    font-style: italic;
    font-size: 0.8rem;
}

/* Admin Panel Responsive */
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2d5a3b;
}

.admin-nav a {
    background: #2d5a3b;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.8rem;
}

@media (min-width: 480px) {
    .admin-nav a {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: #2d5a3b;
    padding: 12px;
    border-radius: 10px;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffcc00;
}

@media (min-width: 480px) {
    .stat-number {
        font-size: 2rem;
    }
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #2d5a3b;
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    th, td {
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* Deposit Page Specific */
.deposit-container {
    max-width: 95%;
    margin: 20px auto;
    padding: 15px;
}

@media (min-width: 480px) {
    .deposit-container {
        max-width: 90%;
        padding: 20px;
    }
}

@media (min-width: 768px) {
    .deposit-container {
        max-width: 650px;
        padding: 30px;
    }
}

.deposit-form select {
    width: 100%;
    max-width: 320px;
    font-size: 0.8rem;
}

@media (min-width: 480px) {
    .deposit-form select {
        font-size: 0.9rem;
        width: 280px;
    }
}

.info-box {
    padding: 12px;
}

.info-row {
    flex-direction: column;
    text-align: center;
    gap: 5px;
}

@media (min-width: 480px) {
    .info-row {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* Withdraw Page Specific */
.withdraw-container {
    max-width: 95%;
    margin: 20px auto;
    padding: 15px;
}

@media (min-width: 480px) {
    .withdraw-container {
        max-width: 90%;
        padding: 20px;
    }
}

@media (min-width: 768px) {
    .withdraw-container {
        max-width: 600px;
        padding: 30px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

@media (max-width: 480px) {
    .hide-mobile {
        display: none;
    }
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Button Styles */
.btn-deposit, .btn-withdraw, .btn-admin, .btn-refresh, .btn-logout {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (min-width: 480px) {
    .btn-deposit, .btn-withdraw, .btn-admin, .btn-refresh, .btn-logout {
        padding: 6px 15px;
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    .btn-deposit, .btn-withdraw, .btn-admin, .btn-refresh, .btn-logout {
        padding: 8px 18px;
        font-size: 0.9rem;
    }
}

.btn-deposit {
    background: #28a745;
    color: white;
}

.btn-deposit:hover {
    background: #218838;
    transform: scale(1.02);
}

.btn-withdraw {
    background: #dc3545;
    color: white;
}

.btn-withdraw:hover {
    background: #c82333;
    transform: scale(1.02);
}

.btn-admin {
    background: #ffcc00;
    color: #1a472a;
}

.btn-admin:hover {
    background: #ffdd44;
    transform: scale(1.02);
}

.btn-refresh {
    background: #007bff;
    color: white;
    padding: 6px 12px;
}

.btn-refresh:hover {
    background: #0056b3;
    transform: scale(1.02);
}

.btn-logout {
    background: #6c757d;
    color: white;
}

.btn-logout:hover {
    background: #5a6268;
    transform: scale(1.02);
}

/* User Info Container */
.user-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #0a2a1a;
    padding: 8px 12px;
    border-radius: 10px;
    width: 100%;
}

@media (min-width: 768px) {
    .user-info {
        width: auto;
        flex-wrap: nowrap;
    }
}

.user-info span {
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .user-info span {
        font-size: 0.8rem;
    }
}

.balance-display {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffcc00;
}

@media (max-width: 480px) {
    .balance-display {
        font-size: 1rem;
    }
}

/* Two Column Layout */
.two-column-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 992px) {
    .two-column-layout {
        flex-direction: row;
    }
    
    .left-column {
        flex: 1;
        min-width: 250px;
    }
    
    .right-column {
        flex: 1.5;
        min-width: 300px;
    }
}

/* Left Column - History Sections */
.left-column .history-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #0a2a1a;
    border-radius: 10px;
}

.left-column .history-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2d5a3b;
}

.left-column .transaction-list {
    max-height: 200px;
    overflow-y: auto;
}

@media (min-width: 992px) {
    .left-column .transaction-list {
        max-height: 250px;
    }
}

/* Remove refresh buttons since AJAX handles updates */
.history-btn {
    display: none;
}

/* Auto-refresh indicator */
.auto-refresh {
    font-size: 10px;
    color: #aaa;
    text-align: right;
    margin-top: 5px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .left-column .transaction-list {
        max-height: 150px;
    }
    
    .stats-grid {
        gap: 8px;
    }
}