/* ============================================================
   SRV-SERVICES MODAL SYSTEM (Isolated Design)
   Matched to Goal Image Aesthetic - CLEAN VERSION (No Side Bar)
   ============================================================ */

/* Modal Backdrop */
.srv-modal,
.srv-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden !important;
    /* BACKDROP SHOULD NEVER SCROLL */
}

/* Background Locking Classes */
html.srv-locked,
body.srv-locked {
    overflow: hidden !important;
    height: 100% !important;
    position: relative !important;
}

.srv-modal.active,
.srv-detail-modal.active {
    display: flex;
    opacity: 1;
}

.srv-modal-overlay,
.srv-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

/* Modal Main Container */
.srv-modal-container,
.srv-detail-container {
    position: relative;
    background: #232120 !important;
    /* Goal Image Warm Gray */
    border: 1px solid rgba(201, 169, 97, 0.35);
    border-radius: 20px;
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(201, 169, 97, 0.1);
    animation: srvScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    /* PREVENT CONTAINER SCROLL */
}

@keyframes srvScaleUp {
    from {
        transform: scale(0.96);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Close Button (Left Top) */
.srv-close-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(201, 169, 97, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100001;
    color: #C9A961;
    font-size: 14px;
}

.srv-close-btn:hover {
    background: #C9A961;
    color: #000;
    transform: rotate(90deg);
}

/* Modal Header */
.srv-modal-header {
    text-align: center;
    padding: 45px 50px 20px;
    border-bottom: 1px solid rgba(201, 169, 97, 0.2);
    margin-bottom: 10px;
}

.srv-modal-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #C9A961;
    margin: 0;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0.5px;
}

/* Modal Body Content */
.srv-modal-content {
    padding: 10px 45px 20px;
    /* Reduced bottom padding */
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Modal Footer (Sticky) */
.srv-modal-footer {
    padding: 20px 45px 35px;
    border-top: 1px solid rgba(201, 169, 97, 0.15);
    display: flex;
    justify-content: flex-end;
    background: #232120;
    z-index: 100002;
}

[dir="rtl"] .srv-modal-footer {
    justify-content: flex-start;
}

/* Services Rows Layout (Perfect Goal Image Match) */
.srv-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px !important;
    background: #1e1c1b;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 18px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.srv-list-item:hover {
    background: #282625;
    border-color: rgba(201, 169, 97, 0.4) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* RTL Layout Fixes */
[dir="rtl"] .srv-list-item {
    flex-direction: row;
    /* Flex default starts at right in RTL */
}

[dir="rtl"] .srv-details-btn {
    flex-direction: row-reverse;
    /* Icon on the left of text in RTL pill */
}

/* Right grouping: [Checkmark] [Name] */
.srv-item-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-direction: row;
    /* Default: Check then Name */
}

[dir="rtl"] .srv-item-info {
    flex-direction: row;
    /* In RTL, row starts at right, so Check (1st) is rightmost */
}

.srv-item-name {
    color: #fff !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    font-family: 'Cairo', sans-serif;
}

/* Circular Checkmark */
.srv-check-wrapper {
    width: 36px;
    height: 36px;
    background: #C9A961;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 18px;
    box-shadow: 0 0 12px rgba(201, 169, 97, 0.2);
}

/* Details Pill Button (on Left in RTL) */
.srv-details-btn {
    background: #C9A961 !important;
    border: none;
    border-radius: 50px !important;
    color: #000 !important;
    padding: 7px 18px !important;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px !important;
    font-weight: 800 !important;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.srv-details-btn:hover {
    background: #e5c05b !important;
    transform: scale(1.04);
}

.srv-details-btn i {
    font-size: 10px;
    background: #000;
    color: #C9A961;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Request Service Button (Bottom Right) */
.srv-request-btn {
    background: linear-gradient(135deg, #DC143C 0%, #8B0000 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 14px 28px !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    align-self: center;
    margin-top: 0;
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.4);
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .srv-request-btn {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.srv-request-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.6);
}

/* Custom Scrollbar for Srv Content */
.srv-modal-content::-webkit-scrollbar {
    width: 6px;
}

.srv-modal-content::-webkit-scrollbar-thumb {
    background: #C9A961;
    border-radius: 10px;
}

/* Special Case: Detail/Description Modal Text */
.srv-detail-description {
    font-size: 1.2rem;
    line-height: 2;
    color: #eee;
    text-align: justify;
    font-family: 'Cairo', sans-serif;
}

/* Responsive Logic */
@media (max-width: 768px) {
    .srv-modal-container {
        padding: 0;
    }

    .srv-modal-header {
        padding: 40px 30px 10px;
    }

    .srv-modal-content {
        padding: 10px 20px 30px;
    }

    .srv-list-item {
        padding: 15px 20px !important;
    }

    .srv-item-name {
        font-size: 1rem !important;
    }
}