/* Main styles for Taekwondo Tournament Management System */

/* General settings */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Color gradients */
.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0 !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}


.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border: none;
    color: #212529;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* فرم‌ها */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* آلبوم‌ها */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* جدول‌ها */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ناوبری */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
    width: 100% !important;
}

body {
    padding-top: 80px !important;
}

@media (max-width: 991.98px) {
    body {
        padding-top: 70px !important;
    }
    .navbar-toggler {
        display: block !important;
        position: absolute !important;
        right: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 1031 !important;
    }
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #fff !important;
    transform: translateY(-1px);
}

/* بخش قهرمان */
.hero-section {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 50%, #004085 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* آمار */
.stats-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-label {
    color: #6c757d;
    font-size: 1.1rem;
}

/* مسابقات */
.tournament-card {
    height: 100%;
    transition: all 0.3s ease;
}

.tournament-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tournament-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background: #28a745;
    color: white;
}

.status-pending {
    background: #ffc107;
    color: #212529;
}

.status-completed {
    background: #6c757d;
    color: white;
}

/* داشبورد */
.dashboard-stats {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* جدول مسابقات */
.bracket-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.bracket-svg {
    max-width: 100%;
    height: auto;
}

/* پروفایل */
.profile-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 3rem 0;
    border-radius: 0 0 20px 20px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
}

/* فوتر */
footer {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
    color: white;
    margin-top: 4rem;
}

/* انیمیشن‌ها */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .tournament-card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* حالت تاریک */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .form-control {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .table {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .table thead th {
        background-color: #404040;
        color: #ffffff;
    }
    
    .table tbody tr:hover {
        background-color: #404040;
    }
}

/* اسکرول بار سفارشی */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* لودینگ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* نوتیفیکیشن */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* مودال */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 15px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
} 

/* Fix text color issues for better readability */
.text-muted {
    color: #6c757d !important;
}

.card-body .text-muted {
    color: #495057 !important;
}

.table .text-muted {
    color: #495057 !important;
}

.badge {
    color: #fff !important;
}

.btn-outline-primary {
    color: #007bff !important;
    border-color: #007bff !important;
}

.btn-outline-success {
    color: #28a745 !important;
    border-color: #28a745 !important;
}

.btn-outline-warning {
    color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.btn-outline-info {
    color: #17a2b8 !important;
    border-color: #17a2b8 !important;
}

.btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
}

/* Ensure form labels are readable */
.form-label {
    color: #495057 !important;
    font-weight: 500;
}

/* Ensure table headers are readable */
.table thead th {
    color: #495057 !important;
    font-weight: 600;
}

/* Ensure card headers are readable */
.card-header {
    color: #495057 !important;
}

/* Ensure alert text is readable */
.alert {
    color: #495057 !important;
}

.alert-info {
    color: #0c5460 !important;
}

.alert-warning {
    color: #856404 !important;
}

.alert-danger {
    color: #721c24 !important;
}

.alert-success {
    color: #155724 !important;
} 

/* Ensure dropdown menus are visible */
.dropdown-menu {
    z-index: 1050 !important;
    background-color: #fff !important;
    border: 1px solid rgba(0,0,0,.15) !important;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175) !important;
}

.dropdown-item {
    color: #495057 !important;
    background-color: transparent !important;
}

.dropdown-item:hover {
    color: #16181b !important;
    background-color: #f8f9fa !important;
}

.dropdown-item:focus {
    color: #16181b !important;
    background-color: #f8f9fa !important;
}

/* Banner Styles */
.banner-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.banner-link {
    display: block;
    text-decoration: none;
}

.banner-image {
    border-radius: 10px;
    max-height: 200px;
    object-fit: cover;
}

/* Responsive banner adjustments */
@media (max-width: 768px) {
    .banner-image {
        max-height: 150px;
    }
}

/* Admin Sidebar Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        left: -250px;
        height: 100vh;
        width: 250px;
        z-index: 1040;
        transition: left 0.3s ease-in-out;
        background-color: #f8f9fa !important;
        border-right: 1px solid #dee2e6;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .navbar-toggler {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .sidebar {
        position: sticky !important;
        top: 0;
        height: calc(100vh - 56px);
        left: 0 !important;
    }
    
    .navbar-toggler {
        display: none !important;
    }
}

/* Mobile menu toggle button */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    display: none;
}

.sidebar-overlay.show {
    display: block;
} 


.navbar, .navbar * {
    z-index: 9999 !important;
}

.navbar-toggler {
    z-index: 10000 !important;
}