/* assets/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --primary-color: #6a11cb;
    --text-color: #ffffff;
    --sidebar-width: 260px;
}

body {
    font-family: 'Cairo', sans-serif;
    /* خلفية متدرجة عميقة لظهور تأثير الزجاج */
    background: linear-gradient(135deg, #141e30 0%, #243b55 100%);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Class */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
}

/* Layout Structure */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar Styling */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s;
    position: fixed;
    top: 0;
    right: 0; /* RTL: Sidebar on the right */
    z-index: 999;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 15px 25px;
    font-size: 1.1em;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: 0.3s;
    border-right: 3px solid transparent;
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    background: rgba(255, 255, 255, 0.1);
    border-right: 3px solid #fff;
    padding-right: 20px;
}

#sidebar ul li a i {
    margin-left: 10px;
}

/* Content Area */
#content {
    width: 100%;
    margin-right: var(--sidebar-width); /* Push content based on sidebar */
    padding: 20px;
    transition: all 0.3s;
}

/* Navbar Styling */
.navbar-glass {
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
}

/* Tables in Glass */
.table-glass {
    width: 100%;
    color: #fff;
    border-collapse: separate;
    border-spacing: 0 10px; /* Space between rows */
}

.table-glass thead th {
    border: none;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 0 10px 10px 0;
}

.table-glass tbody tr {
    background: rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.table-glass tbody tr:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.01);
}

.table-glass td {
    padding: 15px;
    border: none;
}

/* Inputs */
.form-control-glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
}
.form-control-glass:focus {
    background: rgba(0, 0, 0, 0.4);
    outline: none;
    border-color: #fff;
}

/* Buttons */
.btn-glass {
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: 0.3s;
}
.btn-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Login Page Specific */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.login-box {
    width: 400px;
    padding: 40px;
}
.table-dark-custom {
    background-color: #1e1e2f; /* لون خلفية ثابت */
    color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.table-dark-custom thead th {
    background-color: #27293d;
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 15px;
    border-bottom: 2px solid #3e3e5e;
}

.table-dark-custom tbody tr {
    transition: all 0.2s ease-in-out;
    border-bottom: 1px solid #2d2d44;
}

.table-dark-custom tbody tr:hover {
    background-color: #2d2d44; /* تأثير Hover واضح */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 10;
    position: relative;
}

.table-dark-custom td {
    padding: 12px 15px;
    vertical-align: middle;
    font-size: 0.95rem;
}

/* تحسين الأيقونات والأزرار */
.btn-icon-only {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: 0.2s;
}

.btn-icon-only:hover {
    transform: scale(1.1);
}

/* شارات الحالة (Badges) */
.badge-soft-info {
    background-color: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.badge-soft-warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-soft-success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

/* تحسين زر التوسيع */
.btn-expand-custom {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: 0.3s;
}

.btn-expand-custom:hover, .btn-active-expand {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    transform: rotate(90deg);
}

/* النصوص الثانوية */
.text-muted-light {
    color: #aab8c5 !important;
    font-size: 0.85rem;
}

/* تمييز طبقة الـ Sub-trips */
.sub-trips-list {
    border-radius: 0 0 8px 8px;
}

.variant-header {
    border-radius: 8px 8px 0 0;
}

/* زر صغير جداً للإجراءات داخل الجدول الفرعي */
.btn-xs {
    padding: 2px 6px;
    font-size: 0.7rem;
    line-height: 1.2;
}

/* تأثير عند تمرير الماوس على رحلة المنصة */
.sub-trips-list tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* تنسيق شريط الأسعار الصغير */
.sub-trips-list .badge {
    font-weight: normal;
}
.trip-select {
  width: 260px;
}

.trip-select option {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* إصلاح تداخل Select2 مع Bootstrap Modal */
.select2-container--bootstrap-5 .select2-selection {
    background-color: #1e293b !important; /* لون داكن ليناسب الثيم */
    border: 1px solid #334155 !important;
    color: white !important;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #f8fafc !important;
    padding-right: 15px;
}

/* لجعل القائمة المنسدلة تظهر فوق المودال وبنفس الثيم */
.select2-dropdown {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: white !important;
    z-index: 9999;
}

.select2-results__option--highlighted {
    background-color: #38bdf8 !important; /* لون أزرق عند الاختيار */
}

/* منع تداخل الحقول داخل المودال */
#subTripForm .col-md-4, #subTripForm .col-md-6, #subTripForm .col-md-12 {
    margin-bottom: 15px;
}
/* إصلاح قائمة Select2 لتكون صلبة وغير شفافة */
.select2-container--bootstrap-5 .select2-dropdown {
    background-color: #1e293b !important; /* لون غامق صلب */
    border: 1px solid #38bdf8 !important;
    z-index: 10001 !important; /* للتأكد من ظهورها فوق المودال */
}

.select2-container--bootstrap-5 .select2-results__option {
    color: #f8fafc !important;
    padding: 10px 15px !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #38bdf8 !important;
    color: #000 !important;
}

/* تحسين شكل خانة البحث داخل القائمة */
.select2-search__field {
    background-color: #0f172a !important;
    color: white !important;
    border: 1px solid #334155 !important;
}

/* تنسيق السيلكت نفسه ليظهر بشكل احترافي */
.select2-container--bootstrap-5 .select2-selection {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    height: 45px !important;
    display: flex !important;
    align-items: center !important;
}
.select2-results__options{
    background-color: black !important;
}
.form-control-custom {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid #334155 !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 12px 15px !important;
    width: 100%;
    transition: 0.3s;
}

.form-control-custom:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2) !important;
    outline: none;
}

/* تكبير خانة الوصف */
textarea.form-control-custom {
    min-height: 120px;
    line-height: 1.6;
}

/* تمييز الحقول المخصصة للـ AI */
input[id^="ai_"], textarea[id^="ai_"] {
    border-right: 4px solid #fbbf24 !important;
}
@keyframes highlight-flash {
    0% { background-color: rgba(56, 189, 248, 0.5); transform: scale(1.05); }
    100% { background-color: transparent; transform: scale(1); }
}
.updated-price-highlight {
    animation: highlight-flash 2s ease-out;
    border: 1px solid #38bdf8 !important;
}
#suggestionsList .suggestion-item {
    background: transparent;
    color: #fff;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}

#suggestionsList .suggestion-item:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

#suggestionsList .suggestion-item strong {
    color: #fbbf24; /* تمييز الأيام */
}
/* الحاوية الأب للبحث يجب أن تسمح بظهور العناصر الخارجة منها */
.search-wrapper {
    position: relative;
    overflow: visible !important;
}

#searchSuggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b !important; /* لون داكن صلب لمنع التداخل */
    border: 1px solid #38bdf8;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 999999 !important; /* رقم فلكي لضمان الظهور فوق كل شيء */
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:hover {
    background: #2d3e5a;
}

.suggestion-item .hash-text { color: #fff; font-weight: 600; }
.suggestion-item .type-badge { font-size: 10px; color: #38bdf8; opacity: 0.8; }
.workspace-floating-bar {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 12px 25px;
    border-radius: 50px;
    z-index: 3456789;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease-out;
}
.hide{
    display: none;
}
@keyframes slideUp { from { bottom: -100px; } to { bottom: 30px; } }
.master-select-checkbox { cursor: pointer; border: 1px solid #334155; background: transparent; }
.master-select-checkbox:checked { background-color: #0ea5e9; border-color: #0ea5e9; }
.select2-selection__choice__display{
    color: greenyellow !important;
}
.select2-search__field{
    width: 17.5em !important;
}
.meu{
    color:white !important;
    background-color: green !important;
    transform: rotate(90deg) !important;
}
/* تنسيق قائمة الاقتراحات لتكون زجاجية وتظهر فوق المودال */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999; /* أهم نقطة: أعلى من المودال */
    background: rgba(255, 255, 255, 0.95); /* خلفية شبه شفافة */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none; /* مخفية افتراضياً */
}

/* في الوضع الليلي أو الثيم الداكن */
.glass-panel .suggestions-list {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.suggestions-list li {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: #333;
    transition: all 0.2s;
}

.glass-panel .suggestions-list li {
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.suggestions-list li:hover {
    background-color: #17a2b8; /* لون الـ info */
    color: #fff;
    padding-right: 15px; /* حركة بسيطة عند الهوفر */
}
.bulk-floating-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 12px 25px;
    border-radius: 50px; /* تصميم Pill */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    animation: slideUpFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.count-badge {
    background: #0ea5e9;
    color: white;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
}

.divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.15);
}

.btn-bulk-move {
    background: #38bdf8;
    color: #0f172a;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    font-weight: bold;
    font-size: 0.85rem;
    transition: 0.3s;
}

.btn-bulk-move:hover {
    background: #fff;
    transform: translateY(-2px);
}

.btn-bulk-clear {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: 0.3s;
}

.btn-bulk-clear:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translate(-50%, 50px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.cursor-pointer {
    cursor: pointer;
}

.transition-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.sub-trips-collapse-wrapper {
    /* يمكنك جعلها مخفية افتراضياً إذا أردت بالسطر القادم */
    /* display: none; */
    overflow: hidden;
}

.variant-header:hover {
    background: rgba(56, 189, 248, 0.1) !important;
}
