/* AsbDavani Custom Styles */

/* Vazirmatn Font */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* RTL Support */
body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    text-align: right;
}

/* Custom Navbar */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
}

/* Cards */
.card {
    border-radius: 0.5rem;
    overflow: hidden;
}

.card-header {
    font-weight: bold;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: bold;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: 0.375rem;
}

/* Alerts */
.alert {
    border-radius: 0.5rem;
}

/* Badges */
.badge {
    font-size: 0.75rem;
}

/* Modal Footer RTL */
.modal-footer {
    justify-content: flex-start;
}
.modal-footer .btn-primary::after,
.modal-footer .btn-success::after {
    content: ' | ';
    margin-right: 0.25rem;
    opacity: 0.6;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--primary-color);
}

.page-link:hover {
    color: var(--primary-color);
}

/* Race Cards */
.race-card {
    transition: transform 0.2s;
}

.race-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.bet-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 0.25rem;
    text-align: center;
    min-width: 60px;
}

.bet-type-pey-ber {
    background-color: #e3f2fd;
    color: #1976d2;
}

.bet-type-pish-ber {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.bet-type-miyan-ber {
    background-color: #e8f5e8;
    color: #388e3c;
}

/* Wallet */
.wallet-balance {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success-color);
}

/* Performance Tables */
.performance-table th,
.performance-table td {
    text-align: center;
    vertical-align: middle;
}

/* News Cards */
.news-card {
    height: 100%;
}

.news-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Admin Panel */
.admin-sidebar {
    background-color: var(--dark-color);
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

.admin-content {
    padding: 2rem;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-overlay.show {
    display: flex;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .admin-sidebar {
        min-height: auto;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* ========== جدول مسابقات (Racecards) ========== */
.racecards-page { font-family: 'Vazirmatn', sans-serif; }

.racecards-season-title h5 { font-weight: 700; }

.racecard-block { page-break-inside: avoid; }

.racecard-number-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #c62828;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

.racecard-title { font-weight: 600; }

.racecard-prize { font-size: 0.9rem; white-space: nowrap; }

.racecard-participants thead th { font-weight: 600; white-space: nowrap; }

.racecard-row-even { background-color: #f8f9fa; }
.racecard-row-odd { background-color: #fff; }

.racecard-rank-box {
    display: inline-block;
    min-width: 32px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
}
.racecard-rank-box.rank-normal { background-color: #2e7d32; color: #fff; }
.racecard-rank-box.rank-scratched { background-color: #c62828; color: #fff; }

.racecard-ior {
    display: inline-block;
    margin-top: 2px;
    padding: 2px 8px;
    background: #e0e0e0;
    border-radius: 4px;
    font-weight: 600;
}

.racecard-table-wrapper .table td,
.racecard-table-wrapper .table th { vertical-align: middle !important; }

@media print {
    .racecards-week-tabs,
    .racecards-round-tabs,
    .racecards-actions,
    .no-print { display: none !important; }
    .racecard-block { break-inside: avoid; }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }

    .card {
        background-color: #2d2d2d;
        border-color: #404040;
    }

    .card-header {
        background-color: #404040;
        border-color: #404040;
    }

    .table {
        color: #ffffff;
    }

    .form-control {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }

    .form-control:focus {
        background-color: #2d2d2d;
        color: #ffffff;
    }
}
