/* Hero Section */
.hero-section {
    position: relative;
    height: clamp(620px, 78vh, 820px);
    min-height: 620px;
    display: flex;
    align-items: center;
    color: var(--white);
    overflow: hidden;
    isolation: isolate;
    background: #07162c;
}

/* Dynamic Color Wave / Slider Background */
.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 500%;
    height: 100%;
    display: flex;
    animation: institutionalHeroShift 50s infinite alternate cubic-bezier(.65, 0, .35, 1);
    z-index: 1;
}

.slide {
    width: 20%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: stretch;
}

.slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(4, 15, 32, 0.92) 0%, rgba(7, 23, 47, 0.82) 46%, rgba(7, 23, 47, 0.58) 100%),
        linear-gradient(180deg, rgba(3, 12, 27, 0.24), rgba(3, 12, 27, 0.7));
}

@keyframes institutionalHeroShift {
    0%, 16% {
        transform: translateX(0);
    }
    20%, 36% {
        transform: translateX(-20%);
    }
    40%, 56% {
        transform: translateX(-40%);
    }
    60%, 76% {
        transform: translateX(-60%);
    }
    80%, 100% {
        transform: translateX(-80%);
    }
}

.hero-slide-content {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding-top: clamp(3rem, 7vh, 6rem);
    padding-bottom: clamp(4.5rem, 9vh, 7rem);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(250px, 0.7fr);
    align-items: end;
    gap: clamp(2.5rem, 7vw, 7rem);
    width: 100%;
}

.hero-copy {
    max-width: 850px;
    min-width: 0;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    color: #f0bd5d;
    background: rgba(240, 189, 93, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(240, 189, 93, 0.3);
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
    transform: translateY(-10px); /* Match text raising */
}

.hero-copy h1,
.hero-copy h2 {
    max-width: 35ch; /* Expanded from 24ch to allow 2 lines instead of 3 */
    margin: 0 0 1.2rem; /* Raised slightly by reducing bottom margin */
    color: #fff;
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 3.8vw, 4.2rem); /* Reduced by one degree */
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: balance;
    text-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-10px); /* Raise slightly upwards */
}

.hero-copy p {
    max-width: 80ch; /* Slightly wider */
    margin: 0;
    color: rgba(241, 245, 249, 0.95);
    font-size: clamp(1rem, 0.9rem + 0.3vw, 1.25rem); /* Reduced by one degree */
    font-weight: 500;
    line-height: 1.85;
    text-wrap: pretty;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    transform: translateY(-10px); /* Raise slightly upwards */
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    background: rgba(11, 31, 58, 0.45);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.hero-actions-label {
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.hero-actions .btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    padding: 0.8rem 1.15rem;
    border-radius: 7px;
    font-size: 0.98rem;
    font-weight: 700;
    text-align: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--white);
    color: var(--white);
}

.btn-outline:hover,
.btn-outline.force-hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover,
.btn-primary.force-hover {
    background-color: var(--accent-hover);
}

.hero-progress {
    position: absolute;
    z-index: 5;
    inset-inline-start: max(2rem, calc((100vw - var(--max-width, 1440px)) / 2));
    bottom: 4rem;
    display: flex;
    gap: 0.5rem;
}

.hero-progress span {
    width: 2.2rem;
    height: 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.32);
}

.hero-progress span:nth-child(1) { animation: progressDot1 50s infinite alternate cubic-bezier(.65, 0, .35, 1); }
.hero-progress span:nth-child(2) { animation: progressDot2 50s infinite alternate cubic-bezier(.65, 0, .35, 1); }
.hero-progress span:nth-child(3) { animation: progressDot3 50s infinite alternate cubic-bezier(.65, 0, .35, 1); }
.hero-progress span:nth-child(4) { animation: progressDot4 50s infinite alternate cubic-bezier(.65, 0, .35, 1); }
.hero-progress span:nth-child(5) { animation: progressDot5 50s infinite alternate cubic-bezier(.65, 0, .35, 1); }

@keyframes progressDot1 {
    0%, 16% { background: var(--accent-color); }
    20%, 100% { background: rgba(255, 255, 255, 0.32); }
}
@keyframes progressDot2 {
    0%, 16% { background: rgba(255, 255, 255, 0.32); }
    20%, 36% { background: var(--accent-color); }
    40%, 100% { background: rgba(255, 255, 255, 0.32); }
}
@keyframes progressDot3 {
    0%, 36% { background: rgba(255, 255, 255, 0.32); }
    40%, 56% { background: var(--accent-color); }
    60%, 100% { background: rgba(255, 255, 255, 0.32); }
}
@keyframes progressDot4 {
    0%, 56% { background: rgba(255, 255, 255, 0.32); }
    60%, 76% { background: var(--accent-color); }
    80%, 100% { background: rgba(255, 255, 255, 0.32); }
}
@keyframes progressDot5 {
    0%, 76% { background: rgba(255, 255, 255, 0.32); }
    80%, 100% { background: var(--accent-color); }
}

html[dir="rtl"] .hero-copy h1,
html[dir="rtl"] .hero-copy h2 {
    font-family: 'Cairo', 'Tahoma', sans-serif;
    letter-spacing: normal;
}

html[dir="rtl"] .hero-copy p {
    font-family: 'Cairo', 'Tahoma', sans-serif;
}

html[dir="rtl"] .hero-kicker,
html[dir="rtl"] .hero-actions-label {
    letter-spacing: normal;
}

/* Complex Experience Circle - Scaled Down */
.scroll-down-circle {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 3rem auto 0;
    /* Reset old styles */
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    border: none;
    animation: none;
    z-index: 20;
    cursor: default;
    /* Not clickable usually with this complexity, but we can keep it */
}

.scroll-down-circle:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* Orbit Rings */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitRotate 10s linear infinite;
    pointer-events: none;
}

.orbit-ring.outer {
    width: 130px;
    height: 130px;
    border: 1px solid rgba(0, 127, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 127, 255, 0.5);
    animation-duration: 12s;
}

.orbit-ring.inner {
    width: 100px;
    height: 100px;
    border: 1px solid rgba(0, 127, 255, 0.5);
    box-shadow: 0 0 12px rgba(0, 127, 255, 0.4);
    animation-duration: 16s;
    animation-direction: reverse;
}

@keyframes orbitRotate {
    0% {
        transform: translate(-50%, -50%) rotateZ(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateZ(360deg);
    }
}

/* Number Container */
.number-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Ensure clickability if needed */
    pointer-events: auto;
    cursor: pointer;
}

.number-13 {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
    backdrop-filter: blur(5px);
    border-radius: 50%;
    width: 85px;
    height: 85px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 10px 20px rgba(0, 50, 100, 0.2),
        inset 0 2px 10px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(0, 127, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
    animation: scalePulse 3s ease-in-out infinite;
}

/* Pulse Animation */
@keyframes scalePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 10px 20px rgba(0, 127, 255, 0.3),
            inset 0 2px 10px rgba(255, 255, 255, 0.5),
            0 0 20px rgba(0, 127, 255, 0.2);
    }

    50% {
        transform: scale(1.1);
        box-shadow:
            0 20px 40px rgba(0, 127, 255, 0.5),
            inset 0 4px 15px rgba(255, 255, 255, 0.6),
            0 0 30px rgba(0, 127, 255, 0.4);
    }
}

.number-display {
    font-size: 2.8rem;
    line-height: 1;
    font-weight: 900;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    /* Adjusted for white bg visibility */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.year-text {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    margin-top: -5px;
}

.hero-experience-text {
    text-align: center;
    max-width: 700px;
    margin: 2rem auto 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #cbd5e1;
    /* Light gray for readability on dark background */
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    padding: 0 1rem;
}

/* Advanced Search Section */
.advanced-search-section {
    margin-top: -50px;
    position: relative;
    z-index: 10;
    padding-bottom: 2rem;
}

.search-results-mini {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 5px;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--off-white);
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-dark);
}

.search-result-item:hover {
    background: var(--off-white);
    color: var(--accent-color);
}

.search-result-item small {
    background: rgba(217, 119, 6, 0.1);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Upcoming Appointments */
/* Upcoming Appointments Section - Robust 3-column layout */
.upcoming-section .container {
    max-width: var(--max-width, 1440px) !important;
    width: 95% !important;
    margin: 0 auto;
}

/* Force the grid to be horizontal with 3 columns on desktop */
.upcoming-section .upcoming-section-group .courses-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    width: 100% !important;
    align-items: stretch !important;
}

/* Ensure no other styles force cards to stack */
.upcoming-section .upcoming-section-group .courses-grid>.course-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

@media (max-width: 992px) {
    .upcoming-section .upcoming-section-group .courses-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .upcoming-section .upcoming-section-group .courses-grid {
        grid-template-columns: 1fr !important;
    }
}

.upcoming-section {
    padding: 4rem 0 2rem;
    background: transparent;
    /* Changed from #f1f5f9 to transparent */
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

.section-header p {
    color: #64748b;
    margin-top: 1rem;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-icon {
    color: var(--accent-color);
    margin-inline-end: 0.5rem;
    font-size: 1.4em;
    vertical-align: middle;
    position: relative;
    top: -4px;
}

.appointment-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-btn {
    padding: 1rem 2.5rem;
    border: none;
    background: var(--off-white);
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.tab-btn.active {
    background: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(217, 119, 6, 0.2);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

/* Departments Section */
.departments-section {
    padding: 2rem 0 3rem;
    background: transparent;
}

.departments-grid {
    display: grid;
    /* 4 columns as requested */
    grid-template-columns: repeat(4, 1fr);
    column-gap: 2rem;
    row-gap: 4rem;
    /* Gap for floating icons between rows */
}

.dept-card {
    background: var(--white);
    padding: 2.5rem 1rem 1.5rem;
    /* Top padding for icon space */
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #cbd5e1;
    /* Visible border */
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: auto;
    min-height: 130px;
    /* Short height = Horizontal Rectangle */
    position: relative;
    /* For absolute icon */
    overflow: visible !important;
    /* Allow icon to float out */
    box-shadow: none;
    /* Flat/Minimal as requested */
}

.dept-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.dept-icon {
    width: 70px;
    height: 70px;
    background: var(--white);
    /* White bg to cover border if needed */
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;

    /* Floating Position */
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.dept-card:hover .dept-icon {
    background: var(--accent-color);
    color: var(--white);
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 8px 15px rgba(217, 119, 6, 0.3);
}

.dept-card h3 {
    /* Reduced based on user feedback to match website base size */
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.dept-count {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

@media (max-width: 1200px) {
    .departments-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .departments-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .departments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .departments-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .departments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .departments-grid {
        grid-template-columns: 1fr;
    }

    .appointment-tabs {
        flex-direction: column;
        align-items: center;
    }

    .tab-btn {
        width: 100%;
    }
}

/* Department Accordions */
.departments-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.dept-accordion-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dept-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    cursor: pointer;
    background: var(--white);
    transition: background 0.2s;
}

.dept-header:hover {
    background: var(--off-white);
}

.dept-accordion-item.active {
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.dept-accordion-item.active .dept-header {
    background: var(--off-white);
    border-bottom: 1px solid var(--border-color);
}

.dept-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dept-icon-box {
    width: 50px;
    height: 50px;
    background: rgba(217, 119, 6, 0.1);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.dept-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.toggle-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
    transition: transform 0.3s;
}

.dept-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--white);
}

.dept-content-inner {
    padding: 1.5rem 2rem;
}

/* Branch Accordions (Nested) */
.branch-accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.branch-accordion-item:last-child {
    margin-bottom: 0;
}

.branch-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.branch-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.branch-accordion-item.active .branch-header {
    background: #e2e8f0;
    color: var(--primary-color);
}

.branch-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--white);
}

/* Course Table */
.courses-table-container {
    padding: 1rem;
    overflow-x: auto;
}

.courses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.courses-table th,
.courses-table td {
    padding: 1rem;
    text-align: right;
    /* RTL Default */
    border-bottom: 1px solid var(--border-color);
}

html[dir="ltr"] .courses-table th,
html[dir="ltr"] .courses-table td {
    text-align: left;
}

.courses-table th {
    background: var(--off-white);
    color: var(--primary-color);
    font-weight: 600;
}

.courses-table tr:hover td {
    background-color: #f1f5f9;
}

.course-link {
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.2s;
}

.course-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.btn-details {
    padding: 0.4rem 1rem;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-block;
    background: transparent;
}

.btn-details:hover {
    background: var(--accent-color);
    color: white;
}

/* Upcoming Wrapper (Card + Related List) */
.upcoming-item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Ensure card inside wrapper behaves */
.upcoming-item-wrapper .similar-card {
    height: auto;
    /* Allow auto height based on content */
    min-height: 200px;
    /* Same main card feel */
}

/* Related Mini List */
.related-mini-list {
    background: var(--light-gray);
    padding: 0.8rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    font-size: 0.9rem;
}

.related-mini-list h6 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-weight: 600;
}

.related-mini-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-mini-list li {
    margin-bottom: 0.4rem;
}

.related-mini-list li:last-child {
    margin-bottom: 0;
}

.related-mini-list a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-mini-list a:hover {
    color: var(--accent-color);
    padding-right: 5px;
    /* RTL nudge */
}

html[dir="rtl"] .related-mini-list {
    border-left: none;
    border-right: 3px solid var(--accent-color);
}

html[dir="rtl"] .related-mini-list a:hover {
    padding-right: 5px;
    padding-left: 0;
}

html[dir="ltr"] .related-mini-list a:hover {
    padding-left: 5px;
}

/* Mini Calendar Widget - Restored Horizontal Grid Style */
.upcoming-mini-calendar {
    grid-column: 1 / -1;
    /* Spans all 3 columns of the 3x3 grid */
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: 2rem;
    display: flex;
    flex-direction: row;
    gap: 3rem;
    box-shadow: 0 6px 20px rgba(2, 6, 23, 0.04);
    align-self: stretch;
    transition: transform .18s ease, box-shadow .18s ease;
    min-height: 220px;
    box-sizing: border-box;
    width: 100%;
    margin-top: 4rem;
    /* Added space above calendar */
}

.upcoming-mini-calendar:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
}

.upcoming-mini-calendar .calendar-header {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    border-bottom: none !important;
    border-right: 1px solid var(--off-white);
    padding: 0 1.5rem 0 0;
    margin: 0;
}

html[dir="rtl"] .upcoming-mini-calendar .calendar-header {
    border-right: none;
    border-left: 1px solid var(--off-white);
    padding: 0 0 0 1.5rem;
}

.upcoming-mini-calendar .calendar-header h4 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.upcoming-mini-calendar .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    text-align: center;
    /* flex removed to prevent aspect-ratio stretching */
}

.upcoming-mini-calendar .calendar-day-name {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 6px 0;
    text-transform: uppercase;
}

.upcoming-mini-calendar .calendar-day {
    aspect-ratio: 1.5;
    /* Wider for horizontal layout */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1rem;
    cursor: default;
    position: relative;
    transition: all 0.2s;
    border: 1px solid transparent;
    background: #f8fafc;
}

.calendar-day.has-event {
    background: rgba(217, 119, 6, 0.08);
    color: var(--accent-color);
    font-weight: 700;
    cursor: pointer;
    border-color: rgba(217, 119, 6, 0.2);
}

.calendar-day.has-event:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.15);
    z-index: 2;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

.calendar-day.today {
    background: var(--off-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
}

.calendar-day.other-month {
    opacity: 0.1;
}

.event-dot {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--accent-color);
    border-radius: 50%;
}

.calendar-day.has-event:hover .event-dot {
    background: white;
}

.calendar-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--off-white);
    width: 100%;
}

.calendar-footer small {
    font-size: 0.85rem;
}

@media (max-width: 1200px) {
    .upcoming-section .courses-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .upcoming-mini-calendar {
        grid-column: 1 / -1;
        flex-direction: column;
        gap: 1rem;
        min-height: auto;
    }

    html[dir="rtl"] .upcoming-mini-calendar .calendar-header,
    .upcoming-mini-calendar .calendar-header {
        border: none;
        padding: 0 0 1rem 0;
        flex: none;
    }
}

@media (max-width: 768px) {
    .upcoming-section .courses-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Request Course Form Styles (Horizontal Grid) */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

/* Force 4 columns for desktop */
.row-4-cols {
    grid-template-columns: repeat(4, 1fr);
}

.row-5-cols {
    grid-template-columns: repeat(5, 1fr);
}

.row-submit {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--off-white);
    transition: all 0.2s;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-color);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* Compact Radio Group */
.radio-group-box {
    display: flex;
    gap: 1rem;
    padding: 0.6rem;
    background: var(--off-white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    height: 42px;
    /* Match input height roughly */
    align-items: center;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    margin: 0;
}

.radio-item input[type="radio"] {
    width: auto;
    height: auto;
    padding: 0;
    border: 1px solid var(--border-color);
    /* Keep subtle border if needed or reset */
    margin: 0;
    background: transparent;
    box-shadow: none;
    accent-color: var(--accent-color);
    /* Modern browser support */
}

/* Fix for generic input focus messing up radio */
.radio-item input[type="radio"]:focus {
    box-shadow: none;
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 2.5rem;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

/* New Responsive Grid Adjustments for Form */
@media (max-width: 1100px) {
    .row-4-cols {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .row-4-cols {
        grid-template-columns: 1fr !important;
    }

    .row-submit {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    /* Request Course Slide-in Visuals */
    .request-course-slide {
        position: relative;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
        border: 1px solid rgba(0, 0, 0, 0.05);
        /* Subtle border */
        overflow: hidden;
        animation: slideDownFade 0.4s ease-out forwards;
        margin-top: 2rem;
        padding: 2.5rem !important;
        /* Override inline padding */
    }

    @keyframes slideDownFade {
        0% {
            opacity: 0;
            transform: translateY(-20px);
            max-height: 0;
        }

        100% {
            opacity: 1;
            transform: translateY(0);
            max-height: 1000px;
            /* Arbitrary large height */
        }
    }

    /* Close Button Styling */
    .close-form-btn {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        /* Will automatically flip for LTR/RTL depending on html dir */
        background: rgba(0, 0, 0, 0.05);
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
        color: var(--text-color);
        font-size: 1.1rem;
        z-index: 10;
    }

    .close-form-btn:hover {
        background: #fee2e2;
        /* Light red bg */
        color: #ef4444;
        /* Red icon */
        transform: rotate(90deg);
    }

    /* RTL Specific Close Button adjustments if needed */
    html[dir="rtl"] .close-form-btn {
        right: auto;
        left: 1.5rem;
    }

    /* Enhanced Input Styling */
    .form-group input,
    .form-group select,
    .form-group textarea {
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        border-radius: 8px;
        /* Slightly more rounded */
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        transition: all 0.2s ease;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        background: #fff;
        border-color: var(--accent-color);
        box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
        transform: translateY(-1px);
    }

    .form-group label {
        font-weight: 600;
        color: var(--primary-color);
        margin-bottom: 0.4rem;
        font-size: 0.9rem;
    }

    /* Section Title Refinement in Form */
    .request-course-slide .section-title h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .request-course-slide .section-title p {
        color: #64748b;
        font-size: 0.95rem;
    }

    .radio-group-box {
        justify-content: space-around;
        width: 100%;
    }
}

/* Compact Mini Calendar for Homepage */
.upcoming-mini-calendar.compact {
    min-height: auto !important;
    /* Allow it to be shorter */
    padding: 1rem 1.5rem !important;
    /* Reduce padding */
    gap: 1.5rem !important;
    /* Reduce gap between header and grid */
}

.upcoming-mini-calendar.compact .calendar-header {
    flex: 0 0 140px !important;
    /* Smaller header width */
    padding-right: 1rem !important;
}

html[dir="rtl"] .upcoming-mini-calendar.compact .calendar-header {
    padding-left: 1rem !important;
    padding-right: 0 !important;
}

.upcoming-mini-calendar.compact .calendar-header h4 {
    /* Smaller month text */
}

.upcoming-mini-calendar.compact .calendar-header img {
    max-height: 40px !important;
    /* Smaller logo */
}

.upcoming-mini-calendar.compact .calendar-grid {
    gap: 4px !important;
    /* Tighter grid */
}

.upcoming-mini-calendar.compact .calendar-day-name {
    padding: 2px 0 !important;
}

.upcoming-mini-calendar.compact .calendar-day {
    aspect-ratio: auto !important;
    /* Remove fixed aspect ratio */
    height: 32px !important;
    /* Fixed small height */
}

.upcoming-mini-calendar.compact .text-muted {
    margin-bottom: 0.5rem !important;
}

/* Wide Mode Mini Calendar (Side-by-Side) */
.upcoming-mini-calendar.wide-mode {
    padding: 2rem 2.5rem !important;
    gap: 2rem !important;
    /* Reduce gap from 3rem base */
    align-items: stretch !important;
    /* Ensure header fills height */
}

/* Specific tweaks for Wide Mode to ensure symmetry */
.upcoming-mini-calendar.wide-mode .calendar-header {
    flex: 0 0 160px !important;
    /* Fixed header width */
}

.upcoming-mini-calendar.wide-mode .calendar-body {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upcoming-mini-calendar.wide-mode .calendar-body {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .upcoming-mini-calendar.wide-mode .calendar-grid-side {
        flex: 1 !important;
    }
}

/* Fix Hero Overflow on Mobile */
@media (max-width: 991px) {
    .hero-section {
        height: auto;
        min-height: auto;
        padding-top: 140px;
        /* Space for header */
        padding-bottom: 4rem;
        /* Reset padding since overlap is removed */
        align-items: flex-start;
        /* Align content to top */
    }

    .hero-content {
        padding-top: 0;
    }

    .hero-experience-text {
        margin-top: 1.5rem;
        padding-bottom: 0;
    }

    /* Reduce overlap on mobile to maintain design but be safer */
    .advanced-search-section {
        margin-top: -30px !important;
    }

    /* Standard padding for Arabic (works fine) */
    .hero-section {
        padding-bottom: 8rem;
    }

    /* ROBUST FIX FOR ENGLISH MOBILE (Request 2026-01-13) */
    html[dir="ltr"] .hero-section {
        /* Remove fixed constraints */
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        /* Allow content to flow out */
        padding-bottom: 12rem !important;
        /* Keep generous space but rely on flow */
        align-items: flex-start !important;
    }

    html[dir="ltr"] .hero-content {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 0;
    }

    html[dir="ltr"] .hero-content h1 {
        /* Resize for mobile */
        line-height: 1.3 !important;
        white-space: normal !important;
        /* Enforce wrapping */
        word-wrap: break-word !important;
        overflow: visible !important;
        height: auto !important;
    }

    html[dir="ltr"] .hero-content p {
        line-height: 1.5 !important;
        white-space: normal !important;
        height: auto !important;
    }

html[dir="ltr"] .hero-experience-text {
        width: 100% !important;
        max-width: none !important;
        white-space: normal !important;
        height: auto !important;
        line-height: 1.6 !important;
        padding: 0 10px !important;
        overflow: visible !important;
        margin-top: 1.5rem;
        padding-bottom: 0;
    }
}

/* Institutional hero responsive safeguards.
   Kept at the end to override legacy homepage hero rules. */
@media (max-width: 991px) {
    .hero-section.institutional-hero,
    html[dir="ltr"] .hero-section.institutional-hero {
        height: clamp(650px, 82vh, 780px) !important;
        min-height: 650px !important;
        padding: 0 !important;
        overflow: hidden !important;
        align-items: stretch !important;
    }

    .institutional-hero .hero-slide-content {
        padding: clamp(7rem, 15vh, 9rem) 1.5rem 5rem;
        align-items: center;
    }

    .institutional-hero .hero-layout {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 2rem;
    }

    .institutional-hero .hero-copy h1,
    .institutional-hero .hero-copy h2 {
        max-width: 18ch;
        font-size: clamp(2.25rem, 7vw, 3.65rem);
    }

    .institutional-hero .hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 560px;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .institutional-hero .hero-actions-label {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .hero-section.institutional-hero,
    html[dir="ltr"] .hero-section.institutional-hero {
        height: 720px !important;
        min-height: 720px !important;
    }

    .institutional-hero .hero-slide-content {
        padding: 7.5rem 1rem 4rem;
    }

    .institutional-hero .hero-kicker {
        margin-bottom: 0.9rem;
        font-size: 0.7rem;
        letter-spacing: 0.08em;
    }

    .institutional-hero .hero-copy h1,
    .institutional-hero .hero-copy h2 {
        max-width: none;
        margin-bottom: 1rem;
        font-size: clamp(2rem, 9.5vw, 2.8rem);
        line-height: 1.12;
    }

    .institutional-hero .hero-copy p {
        font-size: 1rem;
        line-height: 1.65;
    }

    .institutional-hero .hero-layout {
        gap: 1.5rem;
    }

    .institutional-hero .hero-actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.65rem;
    }

    .institutional-hero .hero-actions .btn {
        min-height: 46px;
    }

    .institutional-hero .hero-progress {
        inset-inline-start: 1rem;
        bottom: 5rem;
    }

    .institutional-hero .hero-progress span {
        width: 1.5rem;
    }

    .institutional-hero .slide {
        background-position: 58% center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .institutional-hero .hero-slider,
    .institutional-hero .hero-progress span {
        animation: none !important;
    }
}

/* Fixed country selector above the search panel.
   It belongs to the search section, so it never moves with the hero slides. */
.advanced-search-section .search-container {
    position: relative;
    margin-bottom: 0;
}

.advanced-search-section .country-flags-container {
    top: auto !important;
    bottom: auto !important;
    position: relative !important;
    margin-top: 20px !important;
    margin-bottom: -15px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
    padding-inline: 1rem;
    z-index: 12 !important;
    pointer-events: none;
}

.advanced-search-section .country-flags-container .flag-item {
    pointer-events: auto;
}

/* Hide the span to prevent duplicate text, since data-title is used in ::after */
.advanced-search-section .country-flags-container .flag-item span {
    display: none !important;
}

/* Custom Flag Pill Styling for Desktop */
@media (min-width: 769px) {
    .advanced-search-section .country-flags-container {
        gap: 20px !important;
    }
    .advanced-search-section .country-flags-container .flag-item {
        display: flex !important;
        align-items: center !important;
        background: white !important;
        border-radius: 50px !important;
        padding: 6px 20px 6px 6px !important;
        width: auto !important;
        height: auto !important;
        text-decoration: none !important;
        color: var(--primary-color) !important;
        font-weight: 500 !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important;
    }
    html[dir="rtl"] .advanced-search-section .country-flags-container .flag-item {
        padding: 6px 6px 6px 20px !important;
    }
    .advanced-search-section .country-flags-container .flag-item::after {
        content: attr(data-title) !important;
        position: static !important;
        background: transparent !important;
        color: inherit !important;
        padding: 0 !important;
        box-shadow: none !important;
        font-size: 0.95rem !important;
        opacity: 1 !important;
        transform: none !important;
        margin-inline-start: 10px !important;
        display: block !important;
    }
    .advanced-search-section .country-flags-container .flag-item img {
        width: 36px !important;
        height: 36px !important;
        border-radius: 50% !important;
    }
    .advanced-search-section .country-flags-container .flag-item:hover {
        transform: translateY(-4px) !important;
        border-color: var(--accent-color) !important;
        color: var(--accent-color) !important;
    }
}
@media (max-width: 768px) {
    .advanced-search-section .country-flags-container .flag-item::after {
        display: none !important;
    }
}

.advanced-search-section .search-results-mini {
    top: calc(100% + 8px) !important;
}

/* Compact transition from search to upcoming content. */
.advanced-search-section {
    padding-bottom: 0;
}

.advanced-search-section + .upcoming-section {
    padding-top: clamp(2.25rem, 4vw, 3rem);
}

.advanced-search-section + .upcoming-section .section-header {
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .advanced-search-section .country-flags-container {
        bottom: auto !important;
        gap: 8px !important;
        padding-inline: 0.5rem;
    }

    .advanced-search-section .country-flags-container .flag-item {
        width: 34px;
        height: 34px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    }

    .advanced-search-section + .upcoming-section {
        padding-top: 2rem;
    }
}

/* Mobile Alignment for Standards Grid */
@media (max-width: 768px) {
    .standards-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    .standards-grid .standard-card {
        flex: 1 1 140px !important;
        max-width: 180px !important;
    }
}

/* International Standards Gradient Borders and Hover Effects */
.standards-grid .standard-card {
    border: 2px solid transparent !important;
    background-clip: padding-box, border-box !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
    cursor: pointer;
}

.standards-grid .standard-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 12px 20px rgba(0,0,0,0.08) !important;
}

/* PMI - Purple/Orange */
.standards-grid .standard-card:nth-child(1) {
    background-image: linear-gradient(#f8f9fa, #f8f9fa), linear-gradient(135deg, #6366f1, #f97316) !important;
}
.standards-grid .standard-card:nth-child(1):hover {
    box-shadow: 0 12px 20px rgba(99, 102, 241, 0.2) !important;
}

/* API - Red/Blue */
.standards-grid .standard-card:nth-child(2) {
    background-image: linear-gradient(#f8f9fa, #f8f9fa), linear-gradient(135deg, #ef4444, #3b82f6) !important;
}
.standards-grid .standard-card:nth-child(2):hover {
    box-shadow: 0 12px 20px rgba(239, 68, 68, 0.2) !important;
}

/* ASME - Cyan/Dark Blue */
.standards-grid .standard-card:nth-child(3) {
    background-image: linear-gradient(#f8f9fa, #f8f9fa), linear-gradient(135deg, #0ea5e9, #0284c7) !important;
}
.standards-grid .standard-card:nth-child(3):hover {
    box-shadow: 0 12px 20px rgba(14, 165, 233, 0.2) !important;
}

/* ISO - Blue/Red */
.standards-grid .standard-card:nth-child(4) {
    background-image: linear-gradient(#f8f9fa, #f8f9fa), linear-gradient(135deg, #3b82f6, #ef4444) !important;
}
.standards-grid .standard-card:nth-child(4):hover {
    box-shadow: 0 12px 20px rgba(59, 130, 246, 0.2) !important;
}

/* IEC - Green/Blue */
.standards-grid .standard-card:nth-child(5) {
    background-image: linear-gradient(#f8f9fa, #f8f9fa), linear-gradient(135deg, #10b981, #0ea5e9) !important;
}
.standards-grid .standard-card:nth-child(5):hover {
    box-shadow: 0 12px 20px rgba(16, 185, 129, 0.2) !important;
}

/* Add a subtle shine effect on hover */
.standards-grid .standard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.75s ease;
    z-index: 1;
    pointer-events: none;
}
.standards-grid .standard-card:hover::before {
    left: 200%;
}

/* Dynamic Colors and Animations for Department Icons */
.dept-card .dept-icon i {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dept-card:hover .dept-icon i {
    transform: rotate(15deg) scale(1.15);
}

.dept-card:nth-child(16n+1) .dept-icon { color: #4f46e5 !important; }
.dept-card:nth-child(16n+1):hover .dept-icon { background: #4f46e5 !important; color: #fff !important; box-shadow: 0 8px 15px rgba(79, 70, 229, 0.3) !important; }

.dept-card:nth-child(16n+2) .dept-icon { color: #059669 !important; }
.dept-card:nth-child(16n+2):hover .dept-icon { background: #059669 !important; color: #fff !important; box-shadow: 0 8px 15px rgba(5, 150, 105, 0.3) !important; }

.dept-card:nth-child(16n+3) .dept-icon { color: #ea580c !important; }
.dept-card:nth-child(16n+3):hover .dept-icon { background: #ea580c !important; color: #fff !important; box-shadow: 0 8px 15px rgba(234, 88, 12, 0.3) !important; }

.dept-card:nth-child(16n+4) .dept-icon { color: #db2777 !important; }
.dept-card:nth-child(16n+4):hover .dept-icon { background: #db2777 !important; color: #fff !important; box-shadow: 0 8px 15px rgba(219, 39, 119, 0.3) !important; }

.dept-card:nth-child(16n+5) .dept-icon { color: #0284c7 !important; }
.dept-card:nth-child(16n+5):hover .dept-icon { background: #0284c7 !important; color: #fff !important; box-shadow: 0 8px 15px rgba(2, 132, 199, 0.3) !important; }

.dept-card:nth-child(16n+6) .dept-icon { color: #7c3aed !important; }
.dept-card:nth-child(16n+6):hover .dept-icon { background: #7c3aed !important; color: #fff !important; box-shadow: 0 8px 15px rgba(124, 58, 237, 0.3) !important; }

.dept-card:nth-child(16n+7) .dept-icon { color: #b45309 !important; }
.dept-card:nth-child(16n+7):hover .dept-icon { background: #b45309 !important; color: #fff !important; box-shadow: 0 8px 15px rgba(180, 83, 9, 0.3) !important; }

.dept-card:nth-child(16n+8) .dept-icon { color: #1d4ed8 !important; }
.dept-card:nth-child(16n+8):hover .dept-icon { background: #1d4ed8 !important; color: #fff !important; box-shadow: 0 8px 15px rgba(29, 78, 216, 0.3) !important; }

.dept-card:nth-child(16n+9) .dept-icon { color: #be123c !important; }
.dept-card:nth-child(16n+9):hover .dept-icon { background: #be123c !important; color: #fff !important; box-shadow: 0 8px 15px rgba(190, 18, 60, 0.3) !important; }

.dept-card:nth-child(16n+10) .dept-icon { color: #0f766e !important; }
.dept-card:nth-child(16n+10):hover .dept-icon { background: #0f766e !important; color: #fff !important; box-shadow: 0 8px 15px rgba(15, 118, 110, 0.3) !important; }

.dept-card:nth-child(16n+11) .dept-icon { color: #9333ea !important; }
.dept-card:nth-child(16n+11):hover .dept-icon { background: #9333ea !important; color: #fff !important; box-shadow: 0 8px 15px rgba(147, 51, 234, 0.3) !important; }

.dept-card:nth-child(16n+12) .dept-icon { color: #4338ca !important; }
.dept-card:nth-child(16n+12):hover .dept-icon { background: #4338ca !important; color: #fff !important; box-shadow: 0 8px 15px rgba(67, 56, 202, 0.3) !important; }

.dept-card:nth-child(16n+13) .dept-icon { color: #c2410c !important; }
.dept-card:nth-child(16n+13):hover .dept-icon { background: #c2410c !important; color: #fff !important; box-shadow: 0 8px 15px rgba(194, 65, 12, 0.3) !important; }

.dept-card:nth-child(16n+14) .dept-icon { color: #1e40af !important; }
.dept-card:nth-child(16n+14):hover .dept-icon { background: #1e40af !important; color: #fff !important; box-shadow: 0 8px 15px rgba(30, 64, 175, 0.3) !important; }

.dept-card:nth-child(16n+15) .dept-icon { color: #86198f !important; }
.dept-card:nth-child(16n+15):hover .dept-icon { background: #86198f !important; color: #fff !important; box-shadow: 0 8px 15px rgba(134, 25, 143, 0.3) !important; }

.dept-card:nth-child(16n+16) .dept-icon { color: #0369a1 !important; }
.dept-card:nth-child(16n+16):hover .dept-icon { background: #0369a1 !important; color: #fff !important; box-shadow: 0 8px 15px rgba(3, 105, 161, 0.3) !important; }


/* Slider Text Animations */
@media (prefers-reduced-motion: no-preference) {
    .js-enabled .slide .hero-kicker, 
    .js-enabled .slide h1, 
    .js-enabled .slide h2, 
    .js-enabled .slide p {
        opacity: 0;
        animation-fill-mode: both;
        animation-duration: 0.8s;
        animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
        transform-origin: top center;
    }
    
    .js-enabled .slide.animate-content .hero-kicker, 
    .js-enabled .slide.animate-content h1, 
    .js-enabled .slide.animate-content h2, 
    .js-enabled .slide.animate-content p {
        will-change: opacity, transform;
        animation-name: softRevealDown;
    }
    
    .js-enabled .slide.animate-content .hero-kicker { animation-delay: 0.25s; }
    .js-enabled .slide.animate-content h1,
    .js-enabled .slide.animate-content h2 { animation-delay: 0.50s; }
    .js-enabled .slide.animate-content p { animation-delay: 0.80s; }
    
    @keyframes softRevealDown {
        0% {
            opacity: 0;
            transform: translateY(-12px) scaleY(0.96);
        }
        70% {
            opacity: 1;
            transform: translateY(1px) scaleY(1.01);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scaleY(1);
        }
    }
}

/* =========================================
   SEARCH FORM & COUNTRY FLAGS (Moved from inline HTML)
   ========================================= */

/* Country Flags Overlapping Search Box */
.country-flags-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    animation: fadeInUp 0.8s ease-out 0.2s both;

    /* Half-Inside Half-Outside Logic */
    position: absolute;
    top: calc(100% - 22px);
    left: 0;
    width: 100%;
    z-index: 30;
    margin: 0 !important;
}

/* Fix: Ensure form is above flags */
.search-form {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: nowrap;
}

/* 1. Wrappers behave as rigid boxes */
.search-form .filter-group,
.search-form .search-input-group {
    display: flex;
    align-items: center;
    height: 54px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* 2. Inputs/Selects fill the boxes */
.search-form select,
.search-form input {
    height: 100% !important;
    line-height: normal !important;
    margin: 0 !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    font-size: 14px !important;
    display: block !important;
    width: 100% !important;
}

/* 3. Button behaves like a wrapper + input combined */
.search-form button {
    height: 54px !important;
    min-height: 54px !important;
    padding: 0 40px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: bold !important;
    background-color: var(--accent-color) !important;
    border: 1px solid var(--accent-color) !important;
    color: white !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .search-form .filter-group,
    .search-form .search-input-group,
    .search-form button {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* Specific Widths */
.search-form .search-input-group {
    flex-grow: 2;
    min-width: 250px;
}

.search-form .filter-group {
    flex-grow: 1;
    min-width: 140px;
}

.filter-group {
    position: relative;
    z-index: 51;
}

.search-form select {
    cursor: pointer;
}

.flag-item {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.35), 0 5px 15px rgba(0,0,0,0.25);
    border: 2px solid #fff;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.flag-item:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 15px rgba(0,0,0,0.25);
    z-index: 10;
}

.flag-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.flag-item::after {
    content: attr(data-title);
    position: absolute;
    top: -15px;
    left: -15px;
    bottom: auto;
    transform: none;
    background: #ffffff;
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.flag-item:hover::after {
    opacity: 1;
    transform: translateY(-2px);
}

.search-results-mini {
    top: calc(100% + 45px) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
