:root {
    --primary-color: #2D3A47;
    --secondary-color: #3498db;
    --text-light: #A5B1C2;
    --text-dark: #2D3A47;
    --bg-light: #F8F9FA;
    --border-color: #E9ECEF;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    direction: rtl;
    text-align: right;
}

/* RTL Overrides */
.dropdown-menu {
    right: auto !important;
    left: 0 !important;
    text-align: right;
}

.mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

.ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.modal-header .close {
    margin: -1rem auto -1rem -1rem;
}

.custom-control {
    padding-right: 1.5rem;
    padding-left: 0;
}

.custom-control-label::before,
.custom-control-label::after {
    right: -1.5rem;
    left: auto;
}

.invalid-feedback {
    text-align: right;
}

/* Top Navbar Styling */
.top-navbar {
    height: 70px;
    background: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 280px;
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 30px;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px rgba(0,0,0,0.04);
}

.nav-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-dark);
    margin-left: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--bg-light);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.nav-right {
    display: flex;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-item .user-icon-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-dark);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.nav-item .user-icon-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.user-menu {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    text-decoration: none;
    color: var(--text-dark);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-left: 10px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    font-size: 16px;
    color: var(--text-dark);
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-left: 8px;
}

.user-profile .fa-chevron-down {
    font-size: 12px;
    color: var(--text-light);
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.show .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    margin-top: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-radius: 8px;
    min-width: 200px;
    padding: 8px 0;
}

@media (min-width: 768px) {
    .col-md-12 {
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        max-width: 100%;
        padding-top: 30px;
    }
}
.dropdown-item {
    padding: 10px 20px;
    color: var(--text-dark);
    font-size: 14px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-left: 10px;
    color: var(--text-light);
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 8px 0;
    border-top-color: var(--border-color);
}

@media (max-width: 768px) {
    .top-navbar {
        margin-right: 0;
    }
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.5rem;
    margin-right: 0;
    margin-left: 1rem;
}

.navbar-nav {
    padding-right: 0;
}

.navbar .dropdown-menu {
    right: auto !important;
    left: 0 !important;
}

.nav-link {
    color: rgba(255,255,255,0.8) !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: white !important;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.login-card {
    display: flex;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    box-shadow: 0 0 25px rgba(0,0,0,0.2);
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    direction: rtl;
}

.login-image {
    flex: 1;
    background: url('/images/gaming.jpg') center/cover;
    position: relative;
    min-height: 400px;
}

.login-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.85);
}

.login-image-content {
    position: relative;
    z-index: 1;
    color: white;
    padding: 40px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-image-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: bold;
    color: #fff;
}

.login-image-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.login-form-container {
    flex: 1;
    padding: 40px;
    background: white;
}

.login-header {
    color: var(--primary-color);
    padding: 20px;
    text-align: right;
    font-size: 1.5rem;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.login-body {
    padding: 30px;
}

.form-group {
    text-align: right;
}

.form-control {
    border-radius: 5px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
    background: rgba(236, 240, 241, 0.5);
    transition: all 0.3s ease;
    text-align: right;
}

.form-control:focus {
    background: white;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.btn-login {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    width: 100%;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-login:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Game Room Cards */
.game-room-card {
    height: 100%;
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    background: white;
    overflow: hidden;
    font-size: 0.9rem;
    border: 1px solid #f0f0f0;
}

.game-room-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-body {
    padding: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: -0.3px;
}

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    font-size: 0.8rem;
}

.badge-success {
    background: #4CAF50;
}

.badge-danger {
    background: #f44336;
}

.badge-info {
    background: #2196F3;
}

.badge-primary {
    background: #3f51b5;
}

.badge-warning {
    background: #ff9800;
}

.device-info {
    font-size: 0.9rem;
    font-weight: 500;
    color: #455A64;
    background: #f8f9fa;
    padding: 0.6rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #edf2f7;
}

.timer {
    background: #2c3e50;
    border: none;
    color: #ffffff;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-family: 'Alexandria', monospace;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.15);
}

.session-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 1rem;
}

.session-actions .btn {
    width: 100%;
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    gap: 6px;
    font-size: 0.85rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.session-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.btn-warning {
    background: #ff9800 !important;
    color: white !important;
}

.btn-success {
    background: #4CAF50 !important;
    color: white !important;
}

.btn-info {
    background: #2196F3 !important;
    color: white !important;
}

.btn-secondary {
    background: #607d8b !important;
    color: white !important;
}

.btn-danger {
    background: #f44336 !important;
    color: white !important;
}

.room-available {
    cursor: pointer;
    padding: 1.5rem;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e2e8f0;
}

.room-available:hover {
    background: #ffffff;
    border-color: #2196F3;
    transform: translateY(-2px);
}

.room-available i {
    font-size: 3em;
    margin-bottom: 0.5rem;
    color: #2196F3;
}

.room-available p {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

/* Modal Styling */
.modal-content {
    border-radius: 15px;
    overflow: hidden;
    text-align: right;
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-bottom: none;
}

.modal-title {
    font-weight: bold;
}

.close {
    color: white;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    justify-content: flex-start;
}

.modal-header .close {
    padding: 1rem;
    margin: -1rem auto -1rem -1rem;
}

/* Form Controls */
.custom-control-label {
    padding-right: 15px;
    color: var(--primary-color);
    font-weight: 500;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-secondary {
    background-color: var(--border-color);
    border-color: var(--border-color);
}

/* Cafeteria Section */
.cafeteria-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-align: right;
}

.cafeteria-card .card-header {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Tables */
.table th,
.table td {
    text-align: right;
}

/* Pagination */
.pagination {
    padding-right: 0;
}

/* Alert Messages */
.alert {
    text-align: right;
}

/* List Groups */
.list-group {
    padding-right: 0;
}

/* Input Groups */
.input-group > .input-group-prepend > .input-group-text {
    border-radius: 0 0.25rem 0.25rem 0;
}

.input-group > .input-group-append > .input-group-text {
    border-radius: 0.25rem 0 0 0.25rem;
}

.input-group > .form-control:not(:last-child) {
    border-radius: 0 0.25rem 0.25rem 0;
}

.input-group > .form-control:not(:first-child) {
    border-radius: 0.25rem 0 0 0.25rem;
}

/* Cards */
.card-header {
    text-align: right;
}

/* Breadcrumbs */
.breadcrumb {
    padding-right: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-room-card {
        margin-bottom: 15px;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .timer {
        font-size: 1.5rem;
    }

    .login-card {
        flex-direction: column;
    }
    
    .login-image {
        min-height: 200px;
    }
    
    .login-form-container {
        padding: 20px;
    }

    .navbar-nav {
        text-align: right;
    }
    
    .dropdown-menu {
        text-align: right;
    }

    .navbar {
        margin-right: 0;
    }
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--primary-color);
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    height: 70px;
    padding: 0 25px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header img {
    width: 35px;
    height: 35px;
    margin-left: 15px;
}

.sidebar-header h3 {
    color: white;
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

.sidebar-menu {
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    padding: 0 15px;
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu li.active > a {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu i {
    width: 20px;
    margin-left: 12px;
    font-size: 18px;
}

.fa-chevron-down {
    transition: transform 0.3s ease;
}

.rotate-180 {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 5px 0 5px 35px;
    display: none;
}

.submenu a {
    padding: 8px 15px;
    font-size: 14px;
}

/* تنسيق القائمة المنسدلة في السايدبار */
.sidebar-menu > li > a {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu > li > a .fa-chevron-down {
    margin-right: auto;
    margin-left: 0;
    font-size: 12px;
}

.sidebar-menu > li.active > a,
.sidebar-menu > li > a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.submenu li a {
    padding: 8px 15px 8px 35px;
    display: block;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.submenu li a:hover,
.submenu li.active a {
    color: white;
    background: rgba(255,255,255,0.05);
}

/* Main Content */
.main-content {
    margin-right: 280px;
    padding-top: 70px;
    min-height: 100vh;
    background: var(--bg-light);
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(280px);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .top-navbar {
        right: 0;
    }
    
    .main-content {
        margin-right: 0;
    }
}

/* تصميم الناڤبار الجديد */
.main-navbar {
    background: #ffffff;
    padding: 0.4rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    min-height: 80px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: #2c3e50 !important;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

.navbar-brand img {
    margin-left: 1rem;
    border-radius: 12px;
    height: 35px !important;
    width: auto;
}

.nav-link {
    padding: 0.4rem 0.8rem !important;
    font-weight: 600;
    color: #566a7f !important;
    margin: 0 0.3rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #3498db !important;
    transform: translateY(-1px);
}

.nav-item.active .nav-link {
    background: #3498db;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar-nav .nav-item.active .nav-link:hover {
    background: #2980b9;
    color: #ffffff !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-top: 10px;
    background: #ffffff;
    animation: dropdownFade 0.2s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 0.8rem 1rem;
    color: #566a7f;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #3498db;
}

.dropdown-item.active, 
.dropdown-item:active {
    background: #3498db;
    color: #ffffff;
}

/* تعديل زر التوجل */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    background: #f8f9fa;
    color: #2c3e50;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(44, 62, 80, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* تعديل المحتوى الرئيسي */
.main-content {
    margin-right: 0;
    padding-top: 70px;
}

/* تحسين تباعد البطاقات */
.game-room-card {
    margin-bottom: 1.5rem;
}

/* تعديل المسافات بين العناصر */
.navbar > .container-fluid {
    padding: 0 1rem;
}

/* تعديل حجم الأيقونات */
.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* تعديل المحتوى الرئيسي */
.main-content {
    margin-right: 0;
    padding: 0;
}

/* تنسيق قائمة المستخدم */
.user-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2c3e50 !important;
}

.user-menu .dropdown-menu {
    min-width: 200px;
    padding: 0.5rem;
}

.user-menu .dropdown-item {
    border-radius: 6px;
    margin: 2px 0;
}

/* استيراد خط Alexandria */
@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* تطبيق الخط على كل العناصر */
* {
    font-family: 'Alexandria', sans-serif;
}