/* ========================================
   Rihla Gharb - Styles
   رحلة الغرب - الأنماط
   ======================================== */

/* ===== الحاوية الرئيسية ===== */
.rihla-gharb-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 18px auto;
}

/* ===== الرسائل ===== */
#rihla-gharb-message {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: 700;
    display: none;
}

#rihla-gharb-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#rihla-gharb-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#rihla-gharb-message.info {
    display: block;
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== أقسام العمال ===== */
.worker-section {
    margin-bottom: 20px;
}

.worker-section h3 {
    text-align: center;
    margin-bottom: 15px;
}

/* ===== حقل البحث ===== */
.rihla-gharb-search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.rihla-gharb-search-box {
    display: flex;
    gap: 10px;
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

.rihla-gharb-search-box input {
    width: 250px;
    height: 45px;
    border-radius: 25px;
    border: 1px solid #ddd;
    padding: 0 15px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.rihla-gharb-search-box input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.rihla-gharb-search-box button {
    height: 45px;
    border-radius: 25px;
    padding: 0 25px;
    background: #0073aa;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.rihla-gharb-search-box button:hover {
    background: #005a87;
}

.rihla-gharb-search-box button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* ===== بطاقة معلومات الموظف ===== */
#rihla-gharb-employee-card {
    display: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
}

#rihla-gharb-employee-card h4 {
    color: #0073aa;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

#rihla-gharb-employee-info-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.rihla-info-item {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    border-right: 3px solid #0073aa;
}

.rihla-info-item strong {
    color: #0073aa;
    display: inline-block;
    min-width: 80px;
    font-size: 14px;
}

.rihla-info-item span {
    font-size: 14px;
    color: #333;
}

/* ===== الوجهة والفوج ===== */
.rihla-gharb-destination-group-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.rihla-gharb-destination-group-wrapper > div {
    flex: 1;
    min-width: 150px;
}

.rihla-gharb-destination-group-wrapper > div:nth-child(2) {
    flex: 2;
    min-width: 250px;
}

/* ===== حقول الإدخال ===== */
.rihla-gharb-form-control {
    height: 38px !important;
    line-height: 1.5 !important;
    padding: 6px 12px !important;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.rihla-gharb-form-control:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.rihla-gharb-destination-fixed {
    background: #f8f9fa !important;
    font-weight: bold !important;
    color: #0073aa !important;
    cursor: default;
}

/* ===== زر التسجيل ===== */
.rihla-gharb-btn-success {
    padding: 12px 40px;
    font-size: 18px;
    border-radius: 30px;
    background: #28a745;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
}

.rihla-gharb-btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.rihla-gharb-btn-success:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== رسالة عدد المسجلين ===== */
#group-registration-message {
    display: none;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf1 100%);
    border: 1px solid #0073aa;
    border-radius: 10px;
    color: #0d47a1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

/* ===== معلومات الاتصال ===== */
.rihla-gharb-contact-wrapper {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.rihla-gharb-contact-wrapper h5 {
    color: #0073aa;
    margin-bottom: 20px;
    border-right: 3px solid #0073aa;
    padding-right: 10px;
}

/* ===== تنسيق المودال ===== */
.rihla-gharb-modal .modal-content {
    direction: rtl;
    text-align: right;
}

.rihla-gharb-modal .modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
}

.rihla-gharb-modal .modal-title {
    text-align: center;
    flex: 1;
    font-size: 1.25rem;
    font-weight: bold;
}

.rihla-gharb-modal .btn-close {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.rihla-gharb-modal .modal-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

/* ===== تفاصيل التنبيه ===== */
.rihla-gharb-alert-details {
    background: #fff3cd;
    padding: 15px;
    color: #856404;
}

.rihla-gharb-alert-details ul {
    margin: 5px 0 0 20px;
}

.rihla-gharb-alert-details li {
    margin-bottom: 5px;
}

/* ===== إخفاء قسم اختيار نوع العامل ===== */
.rihla-gharb-worker-type-section {
    display: none !important;
}

/* ===== استجابة للشاشات الصغيرة ===== */
@media (max-width: 768px) {
    .rihla-gharb-box {
        padding: 10px;
    }

    .rihla-gharb-search-box {
        flex-direction: column;
        align-items: center;
        border-radius: 15px;
        padding: 15px;
        max-width: 100%;
    }

    .rihla-gharb-search-box input {
        width: 100%;
        max-width: 300px;
    }

    .rihla-gharb-search-box button {
        width: 100%;
        max-width: 300px;
    }

    #rihla-gharb-employee-info-container {
        grid-template-columns: 1fr;
    }

    .rihla-gharb-destination-group-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .rihla-gharb-destination-group-wrapper > div {
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }

    .rihla-gharb-btn-success {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .rihla-gharb-search-box input {
        font-size: 14px;
    }

    .rihla-gharb-form-control {
        font-size: 13px;
    }

    .rihla-gharb-search-box button {
        font-size: 14px;
        padding: 0 15px;
    }
}

/* ===== إخفاء سهم التفاصيل في Edge ===== */
details summary::-webkit-details-marker {
    display: none;
}

details[open] summary span:last-child {
    transform: rotate(180deg);
}

details summary span:last-child {
    transition: transform 0.3s ease;
}