:root {
    --red: #ff3026;
    --black: #080808;
    --muted: #666;
    --soft: #fff4f3;
    --line: #eeeeee;
}

.portfolio-wrapper {
    padding: 40px 0;
    font-family: Inter, Arial, sans-serif;
    position: relative;
}

.portfolio-app-wrapper {
    padding: 120px 0 40px;

    position: relative;
}

.portfolio-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.portfolio-nav-btns {
    display: flex;
    gap: 10px;
}

.portfolio-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--black);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    user-select: none;
}

.portfolio-nav-btn:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

/* Grid Layout */
.portfolio-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 26px;
    align-items: start;
    transition: opacity 0.2s ease;
}

.portfolio-masonry-grid.loading {
    opacity: 0.4;
    pointer-events: none;
}


.portfolio-brand {
    font-size: 26px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
    color: #fff;
}

.portfolio-details-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}



.portfolio-chip strong {
    color: var(--red);
    margin-right: 4px;
}

.portfolio-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 16px;
}

.portfolio-cta i {
    width: 34px;
    height: 34px;
    background: var(--red);
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition: 0.3s ease;
}

.portfolio-card:hover .portfolio-cta i {
    transform: translateX(5px);
}

/* Pagination Styles */
.portfolio-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 45px;
}

.portfolio-page-num {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: 0.2s ease;
    user-select: none;
}

.portfolio-page-num.active,
.portfolio-page-num:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.portfolio-loader {
    text-align: center;
    padding: 50px;
    font-weight: 700;
    color: var(--muted);
    grid-column: 1 / -1;
}

/* ================= POPUP MODAL STYLES ================= */
.portfolio-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.portfolio-modal.active {
    opacity: 1;
    visibility: visible;
}

.portfolio-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
}

.portfolio-modal-content {
    position: relative;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
    color: #fff;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}


/* Modal Slider */

.modal-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

video.modal-slide-img {
    object-fit: contain;
    background: #000;
}

.modal-slide-img.active {
    display: block;
}


.modal-slider-prev {
    left: 15px;
}

.modal-slider-next {
    right: 15px;
}

.modal-slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.modal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

.modal-dot.active {
    background: var(--red);
    width: 20px;
    border-radius: 10px;
}

/* Modal Text Data */
.modal-info-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
}


.modal-info-body {
    line-height: 1.6;
    color: #ccc;
    font-size: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.modal-external-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: #fff;
    padding: 12px 24px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    margin-top: 20px;
    transition: 0.3s;
}

.modal-external-btn:hover {
    background: #d8241b;
    color: #fff;
}

/* =========================================================================
   PORTFOLIO FILTERS BAR STYLES
   ========================================================================= */

.portfolio-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding: 16px 20px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.portfolio-floating-filters>div {
    flex-grow: 1;
}

/* Filter Group Containers */
.portfolio-filters-bar .filter-group {
    position: relative;
    flex: 1 1 200px;
    /* Flex basis with min-width feel */
    min-width: 160px;
}

/* Custom Dropdown Styling */
.portfolio-filter-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease-in-out;

    /* Native arrow removal for custom SVG icon */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%206B7280' stroke-width='2'><path stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Hover & Focus States */
.portfolio-filter-select:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.portfolio-filter-select:focus {
    background-color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Reset Button Style */
.portfolio-reset-filters-btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.portfolio-reset-filters-btn:hover {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.filter-item {
    position: relative;
    display: flex;
    align-items: center;
}

.single-filter-reset {
    position: absolute;
    right: 30px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 13px;
    padding: 2px 6px;
}

.single-filter-reset:hover {
    color: #ff4d4d;
}

/* Dark Mode Compatibility (If wrapper has dark class or system preference) */
@media (prefers-color-scheme: dark) {
    .portfolio-app-wrapper.dark-theme .portfolio-filters-bar {
        background-color: #1f2937;
        border-color: #374151;
    }

    .portfolio-app-wrapper.dark-theme .portfolio-filter-select {
        background-color: #111827;
        color: #f3f4f6;
        border-color: #4b5563;
    }
}

/* Responsive adjustments for Mobile */
@media (max-width: 640px) {
    .portfolio-filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .portfolio-filters-bar .filter-group {
        width: 100%;
        flex: 1 1 100%;
    }

    .portfolio-reset-filters-btn {
        width: 100%;
        text-align: center;
    }
}

/*==================================== NEW PORTFOLIO CARD =====================================*/
.portfolio-card {



    transition: .35s;



}

.portfolio-card:hover {

    transform: translateY(-8px);

}

.portfolio-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: .7s;
}

video.portfolio-card-bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    top: 0;
    left: 0;
}

.portfolio-card:hover .portfolio-card-bg {

    transform: scale(1.08);

}

.portfolio-card-overlay {

    position: absolute;
    inset: 0;

    background: linear-gradient(to top,
            rgba(0, 0, 0, .88),
            rgba(0, 0, 0, .35),
            rgba(0, 0, 0, .05));

}



.portfolio-tag-secondary {

    display: inline-flex;
    padding: 0px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .2);
    font-size: 12px;
    margin-top: 4px;
    line-height: 24px;
    color: white;

}

.portfolio-title {

    color: #fff;

    font-size: 34px;

    line-height: 1;

    font-weight: 800;

    margin-bottom: 12px;

}

.portfolio-industry {

    color: rgba(255, 255, 255, .85);

    font-size: 17px;

    line-height: 1.5;

    margin-bottom: 28px;

}

.portfolio-cta {

    display: flex;

    justify-content: space-between;

    align-items: center;

    border-top: 1px solid rgba(255, 255, 255, .18);

    padding-top: 20px;

    font-weight: 700;

}

.portfolio-cta span {

    width: 40px;
    height: 40px;

    border-radius: 50%;

    background: #ff3026;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: .3s;

}

.portfolio-card:hover .portfolio-cta span {

    transform: translateX(5px);

}

/*=================================== NEW ===========================*/
:root {

    --primary: #ff3026;

    --black: #080808;

    --gray: #666;

    --line: #ececec;

    --bg: #fafafa;

}

/*=========================
Toolbar
==========================*/

.portfolio-toolbar {

    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    gap: 40px;

    margin-bottom: 50px;

    flex-wrap: wrap;

}

.portfolio-toolbar-label {

    display: block;

    color: var(--primary);

    font-size: 12px;

    font-weight: 700;

    letter-spacing: .15em;

    text-transform: uppercase;

    margin-bottom: 10px;

}

.portfolio-toolbar h3 {

    font-size: 42px;

    font-weight: 800;

    letter-spacing: -.04em;

}

/*=========================
Filters
==========================*/

.portfolio-filters-bar {

    display: flex;

    gap: 16px;

    flex-wrap: wrap;

    align-items: center;

}

.filter-group {

    position: relative;

}

.portfolio-filter-select {

    appearance: none;

    border: none;

    outline: none;

    background: white;

    padding: 16px 55px 16px 20px;

    border-radius: 999px;

    font-size: 15px;

    font-weight: 600;

    min-width: 180px;

    cursor: pointer;

    box-shadow:

        0 8px 30px rgba(0, 0, 0, .05);

    border: 1px solid #eee;

    transition: .3s;

}

.portfolio-filter-select:hover {

    border-color: var(--primary);

}

.portfolio-filter-select:focus {

    border-color: var(--primary);

    box-shadow:

        0 0 0 4px rgba(255, 48, 38, .12);

}

.filter-group::after {

    content: "⌄";

    position: absolute;

    right: 20px;

    top: 50%;

    transform: translateY(-50%);

    pointer-events: none;

    font-size: 14px;

    color: #999;

}

.portfolio-reset-filters-btn {

    height: 52px;

    padding: 0 24px;

    border: none;

    border-radius: 999px;

    background: #111;

    color: #fff;

    font-weight: 700;

    cursor: pointer;

    transition: .3s;

}

.portfolio-reset-filters-btn:hover {

    background: var(--primary);

}

/*=========================
Cards
==========================*/

.portfolio-cards-container {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(324px, 1fr));

    gap: 28px;

    margin-top: 40px;

    margin-bottom: 40px;

}

/*=========================
Pagination
==========================*/

.portfolio-pagination-wrapper {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 16px;

    margin-top: 70px;

}

.portfolio-page-num {

    width: 48px;

    height: 48px;

    border-radius: 50%;

    border: none;

    background: #f5f5f5;

    cursor: pointer;

    font-weight: 700;

    transition: .25s;

}

.portfolio-page-num:hover {

    background: #111;

    color: #fff;

}

.portfolio-page-num.active {

    background: var(--primary);

    color: #fff;

}

.portfolio-nav-btn {

    width: 52px;

    height: 52px;

    border: none;

    border-radius: 50%;

    background: #111;

    color: #fff;

    cursor: pointer;

    font-size: 20px;

    transition: .3s;

}

.portfolio-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portfolio-nav-btn:hover {

    background: var(--primary);

}

/*=========================
CTA
==========================*/

.portfolio-contact-cta {

    margin-top: 72px;
    margin-bottom: 72px;
    padding: 90px 70px;

    border-radius: 34px;

    background:

        linear-gradient(135deg, #080808, #191919);

    color: #fff;

    position: relative;

    overflow: hidden;

}

.portfolio-contact-cta::before {

    content: "";

    position: absolute;

    width: 420px;

    height: 420px;

    background: rgba(255, 48, 38, .12);

    border-radius: 50%;

    right: -140px;

    top: -140px;

    filter: blur(30px);

}

.portfolio-contact-content {

    position: relative;

    z-index: 2;

    max-width: 720px;

}

.portfolio-contact-content h2 {
    color: white;
}

.cta-label {

    display: inline-block;

    padding: 8px 18px;

    border-radius: 999px;

    background: rgba(255, 255, 255, .08);

    backdrop-filter: blur(15px);

    margin-bottom: 18px;

    font-size: 13px;

    letter-spacing: .12em;

    text-transform: uppercase;

    color: #ff6d64;

}

.portfolio-contact-content h2 {

    font-size: 58px;

    line-height: 1;

    font-weight: 800;

    letter-spacing: -.05em;

    margin-bottom: 22px;

}

.portfolio-contact-content p {

    font-size: 18px;

    line-height: 1.8;

    opacity: .85;

    max-width: 560px;

    margin-bottom: 38px;

}

.portfolio-contact-btn {

    display: inline-flex;

    align-items: center;

    gap: 18px;

    padding: 18px 34px;

    background: var(--primary);

    color: #fff;

    border-radius: 999px;

    text-decoration: none;

    font-weight: 700;

    transition: .3s;

}

.portfolio-contact-btn span {

    transition: .3s;

}

.portfolio-contact-btn:hover {

    transform: translateY(-4px);

    box-shadow: 0 20px 45px rgba(255, 48, 38, .35);
    color: white !important;

}

.portfolio-contact-btn:hover span {

    transform: translateX(6px);

}

/*=========================
Responsive
==========================*/

@media(max-width:768px) {

    .portfolio-toolbar {

        flex-direction: column;

        align-items: flex-start;

    }

    .portfolio-toolbar h3 {

        font-size: 34px;

    }

    .portfolio-filters-bar {

        width: 100%;

    }

    .filter-group {

        width: 100%;

    }

    .portfolio-filter-select {

        width: 100%;

    }

    .portfolio-contact-cta {

        padding: 55px 30px;

    }

    .portfolio-contact-content h2 {

        font-size: 38px;

    }

}

/*================================== REDESIGN ===================================*/
/* Header CTA-Style Container */
.portfolio-header-cta {
    background: var(--soft, #fff4f3);
    border-radius: 16px;
    padding: 46px 56px;
    margin-bottom: 40px;
}

.portfolio-header-content .header-label {
    display: inline-block;
    text-transform: uppercase;
    color: var(--red, #ff3026);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.portfolio-header-content h2 {
    font-size: 38px;
    line-height: 1.08;
    letter-spacing: -0.045em;
    font-weight: 880;
    color: var(--black, #070707);
    margin-bottom: 28px;
}

/* Filters Container inside Header */
.portfolio-filters-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Base style for elements (No outer border, individual pills) */
.portfolio-search-input,
.portfolio-filter-select,
.select2-container--default .select2-selection--single,
.portfolio-reset-filters-btn {
    background: #ffffff !important;
    border: none !important;
    /* إلغاء البوردر الخارجي للمجموعة */
    border-radius: 999px !important;
    /* Rounded Corners */
    padding: 12px 22px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--black, #070707) !important;
    outline: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    /* شادو خفيف جداً أساسي */
    transition: all 0.3s ease-in-out !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
}

/* Hover Shadow Effects */
.portfolio-search-input:hover,
.portfolio-search-input:focus,
.portfolio-filter-select:hover,
.select2-container--default .select2-selection--single:hover,
.portfolio-reset-filters-btn:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
    /* بوكس شادو ينشط مع الهوفر */
    transform: translateY(-2px);
}

.portfolio-search-input {
    min-width: 220px;
}

.portfolio-filter-select {
    cursor: pointer;
    appearance: none;
    padding-right: 40px !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff3026' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 14px !important;
}

.portfolio-reset-filters-btn {
    background: var(--red, #ff3026) !important;
    color: #ffffff !important;
    cursor: pointer;
    gap: 8px;
}

/* Adjustments for Responsive View */
@media (max-width: 768px) {
    .portfolio-header-cta {
        padding: 34px 24px;
    }

    .portfolio-search-input,
    .filter-item,
    .portfolio-filter-select {
        width: 100%;
    }
}

/*=============================================================================================*/
/* --- DARK HERO HEADER --- */
.portfolio-hero-header {
    position: relative;
    background: linear-gradient(90deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .68) 47%, rgba(0, 0, 0, .28) 100%),
        radial-gradient(circle at 72% 26%, rgba(255, 48, 38, .42), transparent 24%),
        radial-gradient(circle at 76% 62%, rgba(255, 255, 255, .14), transparent 22%),
        linear-gradient(135deg, #080808 0%, #151515 44%, #2c1110 100%);
    color: #ffffff;
    padding: 60px 0 90px;
    /* مساحة تحتية كافية للبار */
    border-radius: 20px;
    margin-bottom: 50px;
}

.portfolio-hero-container {
    width: min(1180px, 90vw);
    margin: 0 auto;
    position: relative;
}

.portfolio-crumb {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portfolio-hero-header h1 {
    color: #ffffff;
    font-size: 64px;
    line-height: 0.98;
    letter-spacing: -0.05em;
    font-weight: 900;
    margin-bottom: 18px;
}

.portfolio-hero-header h1 span {
    color: var(--red, #ff3026);
}

.portfolio-hero-desc {
    font-size: 20px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.85);
    max-width: 650px;
    margin-bottom: 40px;
    font-weight: 500;
}

/* --- FLOATING FILTERS BAR (Overlapping Effect) --- */
.portfolio-floating-filters {
    position: relative;
    z-index: 10;
    margin-bottom: -125px;
    /* يدفع شريط الفلاتر ليخرج بره الهيدر بمنتصفه */
    background: #ffffff;
    padding: 16px 24px;
    border-radius: 999px;
    /* شكل الكبسولة الدائري */
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    /* بوكس شادو قوي ومريح لتأثير الطفو */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* عناصر الفلاتر والسيرش داخل البار الطائر */
.portfolio-floating-filters .portfolio-search-input,
.portfolio-floating-filters .portfolio-filter-select,
.portfolio-floating-filters .portfolio-reset-filters-btn {
    border: 1px solid #eee !important;
    border-radius: 999px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #111111 !important;
    outline: none !important;
    height: 46px !important;
    background-color: #f9f9f9 !important;
    transition: all 0.25s ease !important;
}

.portfolio-floating-filters .portfolio-search-input {
    min-width: 200px;
    width: 100%;
}

.portfolio-floating-filters .portfolio-reset-filters-btn {
    justify-content: center;
    flex-grow: 1;
}

.portfolio-floating-filters .select_container:after,
.portfolio-floating-filters .select_container:before {
    content: '' !important;
    display: none !important;
}

/* Hover Effects للـ Inputs داخل البار */
.portfolio-floating-filters .portfolio-search-input:hover,
.portfolio-floating-filters .portfolio-search-input:focus,
.portfolio-floating-filters .portfolio-filter-select:hover {
    background-color: #ffffff !important;
    border-color: var(--red, #ff3026) !important;
    box-shadow: 0 6px 16px rgba(255, 48, 38, 0.12) !important;
    transform: translateY(-2px);
}

.portfolio-floating-filters .portfolio-reset-filters-btn:hover {
    box-shadow: 0 6px 16px rgba(255, 48, 38, 0.12) !important;
}

.portfolio-floating-filters .portfolio-filter-select {
    cursor: pointer;
    appearance: none;
    padding-right: 38px !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff3026' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 13px !important;
}

.portfolio-floating-filters .portfolio-reset-filters-btn {
    background: var(--red, #ff3026) !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer;
}

/* ضبط المساحة العلويّة للكروت بسبب البروز */
.portfolio-cards-container {
    padding-top: 60px;
    /* يعطي مساحة عشان الفلاتر المارقة ما تغطيش على أول صف كروت */
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 950px) {
    .portfolio-hero-header h1 {
        font-size: 46px;
    }

    .portfolio-floating-filters {
        border-radius: 20px;
        /* تتحول لمستطيل منحني الحواف في الشاشات الصغيرة */
        margin-bottom: -150px;
    }
}

@media (max-width: 560px) {
    .portfolio-hero-header {
        padding: 40px 0 80px;
    }

    .portfolio-hero-header h1 {
        font-size: 34px;
    }

    .portfolio-floating-filters {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: -220px;
    }

    .portfolio-floating-filters .portfolio-search-input,
    .portfolio-floating-filters .portfolio-filter-select {
        width: 100%;
    }

    .portfolio-cards-container {
        padding-top: 180px;
    }
}

/*==============================================================================================*/
/* --- PORTFOLIO CARD BASE --- */
.portfolio-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    min-height: 324px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.portfolio-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.portfolio-card:hover .portfolio-card-bg {
    transform: scale(1.08);
}

.portfolio-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 1;
}

.portfolio-card-inner {
    position: relative;
    z-index: 2;
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- GLASS STYLE SUB-SECTION BADGE --- */
.card-glass-badge {
    align-self: flex-start;
    background: rgba(147, 147, 147, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 6px 16px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- MARKET ARRAY TAGS WRAPPER --- */
.portfolio-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.portfolio-tag {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--red, #ff3026);
    background: rgba(255, 48, 38, 0.12);
    padding: 0px 16px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

/* --- CARD TEXT STYLES --- */
.portfolio-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.portfolio-industry {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

/*===================================================================================*/
/* --- MODAL BASE & OVERLAY --- */
/* --- MODAL BASE & OVERLAY --- */
.portfolio-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-modal.active {
    opacity: 1;
    visibility: visible;
}

.portfolio-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

/* Modal Content Container */
.portfolio-modal-content {
    position: relative;
    z-index: 2;
    background: #ffffff;
    width: min(1050px, 92vw);
    max-height: 90vh;
    border-radius: 24px;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-modal.active .portfolio-modal-content {
    transform: scale(1);
}

/* Close Button */
.portfolio-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    z-index: 20;
    background: var(--red);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
}

.portfolio-modal-close span {
    line-height: 0;
}

.portfolio-modal-close:hover {
    background: var(--red, #ff3026);
    color: #fff;
    transform: rotate(90deg);
}

/* Layout Grid */
.modal-inner-grid {
    display: grid;

    gap: 32px;
    padding: 36px;
}

/* --- SLIDER STYLES --- */
.modal-slider-wrapper {
    position: relative;
    background: #0f0f0f;
    border-radius: 18px;
    overflow: hidden;
    min-height: 320px;
    max-height: 420px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-slides-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.modal-slide-img {
    width: 100%;
    height: 100% !important;
    object-fit: contain !important;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.modal-slide-img.active {
    opacity: 1;
}

/* Navigation Arrows */
.modal-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s ease;
    user-select: none;
    background: var(--primary);
}

.modal-slider-arrow:hover {
    background: #ffffff;
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.modal-slider-prev {
    left: 16px;
}

.modal-slider-prev svg {
    transform: rotate(180deg);
}

.modal-slider-next {
    right: 16px;
}

/* Dots Pagination */
.modal-slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 999px;
}

.modal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-dot.active {
    background: var(--red, #ff3026);
    width: 22px;
    border-radius: 999px;
}

/* --- DETAILS SECTION --- */
.modal-info-container {
    display: flex;
    flex-direction: column;
}

.modal-info-title {
    font-size: 30px;
    font-weight: 900;
    color: #111;
    margin: 10px 0 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.modal-info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.portfolio-chip {
    background: #f4f4f5;
    padding: 2px 14px;
    border-radius: 999px;
    font-size: 12px;
    color: #333;
}

.modal-info-body {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 24px;
}

.modal-external-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red, #ff3026);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    align-self: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-external-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 48, 38, 0.3);
}

/* --- LOADING SPINNER STATE --- */
.portfolio-modal.loading-state .modal-inner-grid {
    opacity: 0.3;
    pointer-events: none;
}

.portfolio-modal.loading-state::after {
    content: '';
    position: absolute;
    z-index: 100;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--red, #ff3026);
    border-radius: 50%;
    animation: modalSpin 0.8s linear infinite;
}

@keyframes modalSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 850px) {
    .modal-inner-grid {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .modal-slider-wrapper {
        min-height: 280px;
    }
}

/* Select2 Premium Theme Custom Overrides */
.select2-container {
    box-sizing: border-box;
    display: inline-block;
    margin: 0;
    position: relative;
    vertical-align: middle;
}

.select2-container--default .select2-selection--single {
    background-color: #f9f9f9 !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff3026' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 18px center !important;
    background-size: 12px !important;
    border: 1px solid #eee !important;
    border-radius: 999px !important;
    height: 46px !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 20px !important;
    padding-right: 40px !important;
    transition: all 0.25s ease-in-out !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
}

.select2-container--default .select2-selection--single:hover {
    background-color: #ffffff !important;
    border-color: var(--red, #ff3026) !important;
    box-shadow: 0 6px 16px rgba(255, 48, 38, 0.12) !important;
    transform: translateY(-2px);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #111111 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Hide default Select2 arrow entirely to avoid overlap/double arrows */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none !important;
}

/* Select2 Dropdown List styling */
.select2-dropdown {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    z-index: 999999 !important;
    margin-top: 4px !important;
}

.select2-container--default .select2-results__option {
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #444444 !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--red, #ff3026) !important;
    color: #ffffff !important;
}

.select2-container--default .select2-search--dropdown {
    padding: 8px 12px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    outline: none !important;
}

/* Make Reset button smaller and centered */
.portfolio-floating-filters .portfolio-reset-filters-btn {
    height: 36px !important;
    padding: 0 16px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none !important;
    border-radius: 999px !important;
    background: var(--red, #ff3026) !important;
    color: #ffffff !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    align-self: center !important;
    width: auto !important;
    flex-grow: 0 !important;
    box-shadow: 0 4px 10px rgba(255, 48, 38, 0.15) !important;
    transition: all 0.25s ease !important;
}

.portfolio-floating-filters .portfolio-reset-filters-btn:hover {
    background: #d8241b !important;
    box-shadow: 0 6px 15px rgba(255, 48, 38, 0.25) !important;
    transform: translateY(-1px);
}

/* Modal Project Header Custom Styling */
.modal-project-breadcrumb {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--red, #ff3026);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    background: rgba(255, 48, 38, 0.08);
    padding: 4px 12px;
    border-radius: 999px;
    display: inline-block;
    align-self: flex-start;
}

.modal-project-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.modal-project-meta-item {
    background: #f4f4f5;
    padding: 4px 12px;
    border-radius: 8px;
    color: #555;
}

.modal-project-meta-separator {
    color: #ccc;
    font-size: 12px;
}

/* Clean up double arrows from the container selectors */
.filter-item::after,
.filter-group::after {
    display: none !important;
    content: "" !important;
}