/**
 * Character Page Styles
 * This file contains all CSS styles for the character page
 * Critical #image-page CSS moved to header for LCP optimization
 */

/* Arabic Language Specific Styles */
[dir="rtl"] .green > .accordion-button:not(.collapsed)::after,
[lang="ar"] .green > .accordion-button:not(.collapsed)::after {
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="18" height="10" viewBox="0 0 18 10" fill="none"%3E%3Cpath d="M0.665318 9.55581C0.0757522 8.96356 0.0757523 8.00684 0.665318 7.41458L7.60405 0.444192C8.19362 -0.148063 9.14599 -0.148063 9.73556 0.444192L16.6743 7.41458C17.2639 8.00684 17.2639 8.96356 16.6743 9.55581C16.0847 10.1481 15.1323 10.1481 14.5428 9.55581L8.66225 3.66363L2.79682 9.55581C2.20726 10.1481 1.23977 10.1329 0.665318 9.55581Z" fill="%2331A63D" /%3E%3C/svg%3E');
    transform: rotate(0deg);
}

[dir="rtl"] .green > .accordion-button::after,
[lang="ar"] .green > .accordion-button::after {
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="18" height="10" viewBox="0 0 18 10" fill="none"%3E%3Cpath d="M0.665318 9.55581C0.0757522 8.96356 0.0757523 8.00684 0.665318 7.41458L7.60405 0.444192C8.19362 -0.148063 9.14599 -0.148063 9.73556 0.444192L16.6743 7.41458C17.2639 8.00684 17.2639 8.96356 16.6743 9.55581C16.0847 10.1481 15.1323 10.1481 14.5428 9.55581L8.66225 3.66363L2.79682 9.55581C2.20726 10.1481 1.23977 10.1329 0.665318 9.55581Z" fill="%2331A63D" /%3E%3C/svg%3E');
    transform: rotate(180deg);
}

/* Card Slider Styles */
.cardSlid {
    width: 400px;
    border: 1px solid var(--gray-400, #F2F2F2);
    background: var(--gray-white, #FFF);
    border-radius: 8px;
    box-sizing: border-box;
    flex: 0 0 300px;
}

.slider-container {
    width: 100%;
    height: 110px;
    position: relative;
    overflow: hidden;
}

/* على الموبايل: سكرول أصلي للوصول لآخر شخصية */
@media screen and (max-width: 767px) {
    .slider-container {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    [dir="rtl"] .slider-container .inner-slider,
    [lang="ar"] .slider-container .inner-slider {
        position: relative !important;
        transform: none !important;
        right: auto !important;
        padding-left: 12px; /* مساحة بعد آخر عنصر */
    }
    [dir="ltr"] .slider-container .inner-slider,
    [lang="en"] .slider-container .inner-slider {
        position: relative !important;
        transform: none !important;
        left: auto !important;
        padding-right: 12px;
    }
}

/* RTL (Arabic) Slider */
[dir="rtl"] .inner-slider,
[lang="ar"] .inner-slider {
    display: flex;
    gap: 10px;
    position: absolute;
    top: 0;
    right: 0;
}

/* LTR (English) Slider */
[dir="ltr"] .inner-slider,
[lang="en"] .inner-slider {
    display: flex;
    gap: 10px;
    position: absolute;
    top: 0;
    left: 0;
}

.fs-12 {
    font-size: 12px;
}

.family-card {
    width: 93%;
}

@media screen and (max-width: 567px) {
    .family-card {
        width: 100%;
    }
}

.line-clamp {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Table Styles - CLS Optimization */
#table-page {
    contain: layout style;
    min-height: 200px;
}

#table-page .row {
    contain: layout;
}

#table-page .row .col-sm-12 {
    contain: layout;
}

#table-page .table.table-borderless {
    width: 100%;
    table-layout: fixed;
    contain: layout;
}

#table-page .table.table-borderless tbody {
    contain: layout;
}

#table-page .table.table-borderless tbody tr {
    contain: layout;
}

#table-page .table.table-borderless tbody tr th {
    width: 100%;
    contain: layout;
    vertical-align: top;
}

#table-page .table.table-borderless tbody tr th > div {
    min-height: 24px;
    contain: layout;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

#table-page .table.table-borderless tbody tr th .tdInfo {
    display: inline-block;
    min-height: 1.2em;
    vertical-align: top;
    contain: layout;
}

.table > :not(caption) > * > * {
    padding: .5rem 0;
}

.main-ssect > :first-child {
    display: inline;
}

.gray-title {
    margin-top: 10px;
}

.card-video {
    width: 331px;
}

.text-gray-60 {
    color: #828282;
}

.fs-22 {
    font-size: 22px;
}

/* Gallery and Video Modal Styles */
li.img-container img {
    height: 132px;
    width: auto;
    max-width: none;
    border-radius: 12px;
}

li.img-container {
    list-style: none;
    cursor: pointer;
}

#galleryModal,
#videosModal {
    z-index: 10000;
    background: rgba(79, 79, 79, 0.98);
}

#galleryModal .modal-content {
    border-radius: 0 !important;
    background: transparent !important;
    border: none;
}

.gallery-img-container {
    width: 64%;
    height: calc(100vh - 140px);
    padding: 0 3px;
}

.gallery-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top;
    display: block;
}

.gallery-img-container iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.slideContainer .galleryDescription {
    max-width: 36%;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.galleryDescription h1 {
    color: var(--Gray-white, #FFF);
    text-align: right;
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.galleryDescription span {
    color: var(--Gray-400, #F2F2F2);
    text-align: right;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px;
}

.galleryDescription p {
    color: var(--Gray-white, #FFF);
    text-align: right;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.slideContainer {
    gap: 12px;
}

#galleryModal .modal-dialog,
#videosModal .modal-dialog {
    width: 83.431%;
    margin: 28px auto;
    padding: 0;
    max-width: none;
}

.img-container {
    margin: 0 6px;
}

li.img-container:first-child {
    margin: 0;
}

.slickGallery img {
    height: 132px;
    border-radius: 12px;
    border: 1px solid var(--Gray-400, #F2F2F2);
}

.slickGallery .slick-slide:first-child .img-container {
    padding-right: 0;
}

.slickGallery .slick-slide:last-child .img-container {
    padding-left: 0;
}

.slick-disabled path {
    fill: #D4D4D5;
}

.galleryOuterContainer {
    position: relative;
}

#galleryModal .nav-btn,
#videosModal .nav-btn {
    position: absolute;
    top: calc(50% - 22px);
    border: none !important;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
}

#galleryModal .nav-btn path,
#videosModal .nav-btn path {
    fill: #fff;
}

#innerSlidePrevGallery,
#videosPrevButton {
    right: calc(0% - 100px);
}

#innerSlideNextGallery,
#videosNextButton {
    left: calc(0% - 100px);
}

.galleryInfo {
    margin-bottom: 28px;
}

.galleryInfo .btn {
    border: 0 !important;
    background: transparent;
}

.galleryInfo div {
    display: flex;
    color: #C1C1C1;
    line-height: 1;
    letter-spacing: 2px;
}

.galleryInfo div span {
    color: #fff;
    font-size: 18px;
    font-weight: 400;
    line-height: 16px;
}

.galleryInfo div span#totalSlides,
.galleryInfo div span#videosTotalSlides {
    color: #C1C1C1;
}

#galleryModal .slick-arrow.disable path,
#videosModal .slick-arrow.disable path {
    fill: #C1C1C1;
}

#galleryModal .slick-arrow.disable,
#videosModal .slick-arrow.disable {
    cursor: auto;
}

/* English Language Specific Styles */
[lang="en"] #galleryModal .nav-btn,
[lang="en"] #videosModal .nav-btn {
    transform: rotate(360deg) translateY(-50%);
}

[lang="en"] .galleryDescription,
[lang="en"] .galleryDescription h1,
[lang="en"] .galleryDescription span {
    text-align: left;
}

.img-video {
    width: 100%;
    height: 100%;
}

/* Mobile Navigation Bar Styles */
.mobile-nav-bar {
    background: #ebecf0;
    border-bottom: 1px solid #f2f2f2;
    padding: 12px 0;
    position: sticky;
    top: 90px;
    z-index: 998;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0 12px;
    margin: 0;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-tabs::-webkit-scrollbar {
    display: none;
}

.mobile-nav-tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.mobile-nav-link {
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 500;
    color: #0a58ca;
    text-decoration: none;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 20px;
    background: transparent;
    border: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    color: #fff;
    background: #4169e3;
}

.mobile-nav-link.active {
    background: #4169e3;
    color: #fff;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    #galleryModal,
    #videosModal {
        padding: 0 30px !important;
    }

    .slideContainer img,
    .slideContainer iframe {
        max-width: 100%;
    }

    .slideContainer iframe {
        width: 100%;
    }

    .slideContainer .galleryDescription {
        max-width: 100%;
    }

    .gallery-img-container {
        width: 100%;
        height: 360px;
        margin-bottom: 70px;
    }

    #galleryModal .modal-dialog,
    #videosModal .modal-dialog {
        width: 100%;
    }

    .galleryInfo {
        margin-bottom: 25px;
    }

    #galleryModal .nav-btn,
    #videosModal .nav-btn {
        transform: none;
        top: 372px;
        z-index: 999;
        width: 45px;
        height: 45px;
    }

    #galleryModal .nav-btn svg,
    #videosModal .nav-btn svg {
        width: 45px;
        height: 45px;
    }

    #innerSlidePrevGallery,
    #videosPrevButton {
        right: 0;
    }

    #innerSlideNextGallery,
    #videosNextButton {
        left: 0;
    }

    [lang="en"] #galleryModal .nav-btn,
    [lang="en"] #videosModal .nav-btn {
        transform: rotate(360deg);
    }
}

@media screen and (max-width: 576px) {
    .mobile-nav-link {
        font-size: 14px;
        padding: 6px 12px;
        margin: 0 2px;
    }

    .mobile-nav-bar {
        top: 78px;
    }
}

/* Hide scrollbar for mobile */
.mobile-nav-tabs::-webkit-scrollbar {
    height: 0;
}

