/* إعادة الضبط والأنماط الأساسية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #1abc9c;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --light-text: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark-text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* أنماط الهيدر */
.header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.header p {
    color: var(--light-text);
    font-size: 1.1rem;
}

/* المحتوى الرئيسي */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* نماذج التسجيل */
.auth-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* الأزرار */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-full {
    width: 100%;
}

/* الرسائل */
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* صالة الألعاب */
.lobby-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.game-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.bet-selection {
    margin: 25px 0;
}

.bet-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
}

.bet-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bet-option:hover {
    border-color: var(--secondary-color);
}

.bet-option input {
    margin-left: 10px;
}

/* لوحة التحكم */
.dashboard-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--light-bg);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border-left: 5px solid var(--secondary-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* التبويبات */
.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-button {
    padding: 12px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--light-text);
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* الجداول */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--dark-text);
}

/* المودال */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* التجاوب */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .lobby-container {
        grid-template-columns: 1fr;
    }
    
    .bet-options {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-tabs {
        flex-direction: column;
    }
}

/* قطع الدومينو */
.domino-tile {
    width: 60px;
    height: 30px;
    background: white;
    border: 2px solid var(--dark-text);
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.domino-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.domino-tile.selected {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: white;
}

/* لوحة اللعبة */
.board-container {
    background: #27ae60;
    padding: 20px;
    border-radius: 15px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.domino-board {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

/* المؤقت */
.timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--warning-color);
    background: white;
    padding: 5px 15px;
    border-radius: 25px;
    box-shadow: var(--shadow);
}

/* الرصيد */
.balance {
    background: var(--success-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
}