/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors (default theme) */
    --primary-color: #5A2D82;
    --primary-dark: #4a2470;
    --primary-light: #7a3fa0;
    --secondary-color: #0071BC;
    --secondary-dark: #005a94;
    --accent-gold: #CFAE67;
    --accent-green: #6CC24A;
    --accent-orange: #F7941D;
    --accent-red: #C1272D;

    /* Neutral Colors */
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(90, 45, 130, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(90, 45, 130, 0.15);
    --shadow-lg: 0 10px 15px -3px rgba(90, 45, 130, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(90, 45, 130, 0.25);
}

body {
    font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

/* RTL (Arabic) support */
[dir="rtl"] .nav-menu {
    gap: 2rem;
}

[dir="rtl"] .nav-link:hover::after,
[dir="rtl"] .nav-link.active::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .section-title::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

[dir="rtl"] .contact-item {
    border-left: none;
    border-right: 4px solid var(--secondary-color);
}

[dir="rtl"] .contact-item:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .article-link:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .dashboard-placeholder code {
    border-left: none;
    border-right: 3px solid var(--accent-gold);
}

[dir="rtl"] .dashboard-placeholder ol {
    padding-left: 0;
    padding-right: 1.5rem;
}

@media (max-width: 768px) {
    [dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
        transition: right 0.3s ease;
    }

    [dir="rtl"] .nav-menu.active {
        left: auto;
        right: 0;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-brand img {
    display: block;
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-gold) 100%);
    border-radius: 2px;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    height: 500px;
    background: url("images/nav.jpg") center center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hero-overlay, rgba(0, 113, 188, 0.6));
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;

    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {

    font-size: 1.25rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    animation: fadeInUp 0.8s ease 0.4s both;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(90, 45, 130, 0.4);
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(90, 45, 130, 0.25);
}

/* Sections */
section {
    /* it was 80 changes to 40 by KS */
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
    display: block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-gold) 100%);
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 3rem;
}

/* Scales Overview – Article & Table */
.scales-article {
    /* max-width: 800px; commented by KS*/
    margin: 0 auto 2.5rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 12px;
    border-inline-start: 4px solid var(--primary-color);
}

.scales-article-title {
    font-size: 1.35rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.scales-article p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: justify;
}

.scales-article p:last-child {
    margin-bottom: 0;
}

.scales-table-wrap {
    scroll-margin-top: 5rem;
    overflow-x: auto;
    margin-bottom: 2.5rem;
    border-radius: 12px;
    /* box-shadow: var(--shadow-md); */
}

.scales-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    font-size: 1rem;
}

.scales-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.scales-table th {
    padding: 1rem 1.25rem;
    text-align: right;
    font-weight: 600;
}

.scales-table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

.scales-table tbody tr:hover {
    background: rgba(90, 45, 130, 0.04);
}

.scales-table tbody tr:last-child td {
    border-bottom: none;
}

.scale-table-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.scale-table-link:hover {
    color: var(--primary-color);
}

[dir="rtl"] .scales-article {
    border-inline-start: 4px solid var(--primary-color);
    border-inline-end: none;
}

/* About Section */
.about {
    background-color: var(--bg-light);
}

.about-content {
    /* max-width: 800px; commented by KS */
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    /* color: var(--text-light); commented by KS */
}

/* Dashboards Section */
.dashboards {
    background-color: var(--bg-white);
}

/* Infinite Image Slider (gallery_main) - LTR so loop works in RTL pages */
.gallery-slider-section {
    padding: 3rem 0;
}

.gallery-slider-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
    direction: ltr;
}

/* Gradient fade on left and right edges */
.gallery-slider-wrap::before,
.gallery-slider-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    max-width: 15%;
    z-index: 2;
    pointer-events: none;
}

.gallery-slider-wrap::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-white) 0%, transparent 100%);
}

.gallery-slider-wrap::after {
    right: 0;
    left: auto;
    background: linear-gradient(to left, var(--bg-white) 0%, transparent 100%);
}

.gallery-slider-track {
    display: flex;
    flex-direction: row;
    gap: 0;
    width: max-content;
    direction: ltr;
    animation: gallerySliderScroll 45s linear infinite;
    will-change: transform;
}

.gallery-slider-track .gallery-slider-set {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    flex-shrink: 0;
    width: max-content;
    padding-right: 1rem; /* same as gap so last→first has no visual gap when loop repeats */
}

.gallery-slider-item {
    flex-shrink: 0;
    width: 320px;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.gallery-slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes gallerySliderScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.dashboard-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px rgba(90, 45, 130, 0.2);
    border-top: 3px solid var(--accent-gold);
}

.dashboard-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(90, 45, 130, 0.08) 0%, rgba(0, 113, 188, 0.08) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
}

.dashboard-header h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.dashboard-badge {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-orange) 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(207, 174, 103, 0.3);
}

.dashboard-embed {
    position: relative;
    width: 100%;
    min-height: 600px;
    background-color: #f1f5f9;
}

.dashboard-embed iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

.dashboard-placeholder {
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
}

.dashboard-placeholder .placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.dashboard-placeholder h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.dashboard-placeholder code {
    display: block;
    background: linear-gradient(135deg, rgba(90, 45, 130, 0.1) 0%, rgba(0, 113, 188, 0.1) 100%);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: left;
    font-size: 0.875rem;
    color: var(--secondary-color);
    border-left: 3px solid var(--accent-gold);
}

.dashboard-placeholder ol {
    text-align: left;
    max-width: 500px;
    margin: 1rem auto;
    padding-left: 1.5rem;
}

.dashboard-placeholder li {
    margin-bottom: 0.5rem;
}

.placeholder-note {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.dashboard-footer {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(90, 45, 130, 0.05) 0%, rgba(0, 113, 188, 0.05) 100%);
}

.dashboard-description {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Articles Section */
.articles {
    background-color: var(--bg-white);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.article-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border-top: 3px solid var(--accent-gold); /* Set your desired color */

}

.article-card:nth-child(1) .article-image {
    background: linear-gradient(135deg, #5A2D82 0%, #0071BC 100%);
}

.article-card:nth-child(2) .article-image {
    background: linear-gradient(135deg, #0071BC 0%, #6CC24A 100%);
}

.article-card:nth-child(3) .article-image {
    background: linear-gradient(135deg, #F7941D 0%, #CFAE67 100%);
}

.article-card:nth-child(4) .article-image {
    background: linear-gradient(135deg, #5A2D82 0%, #CFAE67 100%);
}

.article-card:nth-child(5) .article-image {
    background: linear-gradient(135deg, #6CC24A 0%, #0071BC 100%);
}

.article-card:nth-child(6) .article-image {
    background: linear-gradient(135deg, #CFAE67 0%, #F7941D 100%);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px rgba(90, 45, 130, 0.2);
}

/* .article-card:nth-child(1):hover {
    border-top-color: var(--primary-color);
}

.article-card:nth-child(2):hover {
    border-top-color: var(--accent-green);
}

.article-card:nth-child(3):hover {
    border-top-color: var(--accent-orange);
}

.article-card:nth-child(4):hover {
    border-top-color: var(--accent-gold);
}

.article-card:nth-child(5):hover {
    border-top-color: var(--secondary-color);
}

.article-card:nth-child(6):hover {
    border-top-color: var(--accent-red);
} */

.article-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.article-image-placeholder {
    font-size: 4rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.article-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-date {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.article-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    /* text-align: justify; */
    color: var(--text-dark);
}

.article-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.article-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.article-link:hover {
    color: var(--secondary-dark);
    transform: translateX(5px);
}

.add-article-section {
    text-align: center;
    margin-top: 2rem;
}

/* contact added by KS */

.contact {
    text-align: center;
    padding: 60px 20px;
}

.contact-icons {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.contact-icon {
    font-size: 28px;
    color: #333;
    background: #f5f5f5;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-icon:hover {
    background: #0077ff;
    color: #fff;
    transform: translateY(-5px);
}

/* Contact Section */
.contact {
    background-color: var(--bg-white);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(90, 45, 130, 0.05) 0%, rgba(0, 113, 188, 0.05) 100%);
    border-radius: 12px;
    border-left: 4px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    font-size: 2rem;
}

.contact-item p {
    font-size: 1.1rem;
    color: var(--text-dark);
}
/* end of contact style old */

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}
.footer .container {
    text-align: center;          /* Center content */
}

.footer p {
    color: #ffffff;              /* White text */
    margin: 0;                   /* Remove default spacing */
    text-align: center; 
}

/* Partners Section */
/* .partners {
    background-color: var(--bg-white);
}

.partners-grid {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    align-items: center;
    justify-items: center;
}

.partner-card {
    background-color: var(--bg-white);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.partner-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-gold);
}

.partner-logo {
    max-width: 140px;
    max-height: 70px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.18));
}

.partner-name {
    font-size: 0.95rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.25rem;
} */


.partners-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

.partners-logos img {
    height: 90px;          /* Control all logos with same height */
    width: auto;           /* Keep aspect ratio */
    object-fit: contain;   /* Prevent distortion */
}
/* Section Spacing */
.partners {
    padding: 50px 0;
}

/* Flex Container to center exactly 3 logos */
.partners-logos-container {
    display: flex;
    justify-content: center;
    /* Centers the group horizontally */
    align-items: center;
    /* Aligns logos of different heights vertically */
    gap: 120px;
    /* Generous spacing between logos */
    flex-wrap: wrap;
    /* Ensures it wraps on mobile */
}

/* Individual Item Wrapper */
.partner-item {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 1 auto;
}

/* Logo Image Styling */
.partner-img {
    max-width: 220px;
    /* Slightly larger since there is no text */
    max-height: 100px;
    /* Keeps the row uniform */
    width: auto;
    height: auto;
    display: block;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.05));
    /* Very subtle depth */
    transition: all 0.3s ease;
}

/* Interaction: Slight zoom on hover */
.partner-item:hover .partner-img {
    transform: scale(1.08);
    filter: drop-shadow(0px 8px 15px rgba(0, 0, 0, 0.1));
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .partners-logos-container {
        gap: 60px;
        /* Reduces gap on smaller screens */
    }

    .partner-img {
        max-width: 160px;
        max-height: 80px;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(90, 45, 130, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--bg-white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
}

.close-modal {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-light);
    background-color: rgba(148, 163, 184, 0.12);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.close-modal:hover {
    background-color: var(--accent-red);
    color: #ffffff;
    transform: translateY(-1px) scale(1.05) rotate(90deg);
    box-shadow: 0 4px 10px rgba(193, 39, 45, 0.35);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--accent-gold);
    padding: 0.5rem 3.5rem 0.5rem 1.5rem;
    /* extra space on the right for the close icon */
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 113, 188, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-md);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 1rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-embed iframe {
        height: 400px;
    }

    .contact-info {
        gap: 1rem;
    }

}

@media (min-width: 769px) and (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Themed pages for each scale */

body.theme-1 {
    --primary-color: #5A2D82;
    /* Purple */
    --primary-dark: #4a2470;
    --secondary-color: #0071BC;
    /* Blue */
    --secondary-dark: #005a94;
    --hero-overlay: rgba(90, 45, 130, 0.65);
}

body.theme-2 {
    --primary-color: #0071BC;
    /* Blue */
    --primary-dark: #005a94;
    --secondary-color: #6CC24A;
    /* Green */
    --secondary-dark: #4f9938;
    --hero-overlay: rgba(0, 113, 188, 0.65);
}

body.theme-3 {
    --primary-color: #6CC24A;
    /* Green */
    --primary-dark: #4f9938;
    --secondary-color: #F7941D;
    /* Orange */
    --secondary-dark: #c86f11;
    --hero-overlay: rgba(108, 194, 74, 0.65);
}

body.theme-4 {
    --primary-color: #F7941D;
    /* Orange */
    --primary-dark: #c86f11;
    --secondary-color: #CFAE67;
    /* Gold */
    --secondary-dark: #a78846;
    --hero-overlay: rgba(247, 148, 29, 0.65);
}

body.theme-5 {
    --primary-color: #CFAE67;
    /* Gold */
    --primary-dark: #a78846;
    --secondary-color: #5A2D82;
    /* Purple */
    --secondary-dark: #4a2470;
    --hero-overlay: rgba(207, 174, 103, 0.65);
}

body.theme-6 {
    --primary-color: #C1272D;
    /* Red */
    --primary-dark: #941920;
    --secondary-color: #F7941D;
    /* Orange */
    --secondary-dark: #c86f11;
    --hero-overlay: rgba(193, 39, 45, 0.65);
}

body.theme-7 {
    --primary-color: #5A2D82;
    /* Purple */
    --primary-dark: #4a2470;
    --secondary-color: #6CC24A;
    /* Green */
    --secondary-dark: #4f9938;
    --hero-overlay: rgba(90, 45, 130, 0.5);
}



/* CSS added by Kulthoom */
p {
    color: #000000;
    /* the black color is not working on the text */
    line-height: 1.6;
    text-align: justify;
}


/* Table Structure */
.scales-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border: 1px solid #ccc;
    /* This ensures it uses the website's default font */
    font-family: inherit;
    color: #000000;
}

/* Header Styling */
.scales-table th {
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    padding: 12px;
    text-align: right;
    color: #000000;
}

/* The Fix: Reduced Cell Padding */
.scales-table td {
    /* Reduced padding: 15px Top/Bottom | 12px Left/Right */
    padding: 15px 12px !important;

    border: 1px solid #ccc;
    vertical-align: top;
    text-align: right;
    color: #000000;
    line-height: 1.6;
}

/* Space under bold titles */
.scales-table td strong {
    display: inline-block;
    margin-bottom: 5px;
    color: #000000;
}

.sub-dim {
    font-weight: bold;
    /* This makes the text bold */
    display: inline-block;
    margin-bottom: 4px;
    color: #000000;
    /* Ensures it stays pure black */
}

/* --- New CSS for the Metadata Table --- */

/* حاوية الجدول لضمان التوسيط والاستجابة */
.scales-table-wrap {
    width: 100%;
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

/* العنوان الرئيسي الملون للجدول (ن = 15,654) */
.table-main-header {
    text-align: center !important;
    background: var(--primary-color) !important;
    color: #ffffff !important;
    padding: 18px !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}

/* تنسيق العناوين الفرعية (أ، ب، ج...) لتمييز الأقسام */
.table-sub-section {
    background-color: var(--bg-light) !important;
    font-weight: bold !important;
    /* border-right: 5px solid var(--secondary-color) !important; */
    color: var(--primary-color) !important;
}

/* ضبط المسافات والألوان داخل خلايا الجدول */
.scales-table td {
    border: 1px solid var(--border-color);
    padding: 12px 15px !important;
    color: #000000;
    vertical-align: middle;
}

/* تنسيق رأس الجدول (المتغيرات، التكرار، النسبة) */
.scales-table thead th {
    background-color: #f1f5f9;
    color: var(--text-dark);
    font-weight: 600;
    border: 1px solid var(--border-color);
}

/* لضمان القراءة بوضوح على الشاشات الصغيرة */
@media (max-width: 768px) {
    .scales-table {
        font-size: 0.9rem;
    }

    .table-main-header {
        font-size: 1rem !important;
    }
}

/* The content of the describtions */

/* Special class to force text to full screen width */
/* Special class to force text to 80% screen width and center it */



/* GRID CONTAINER
   Controls how many cards appear in a row based on screen size. */
/* 1. The Container */
/* Container for the circular items */
/* --- 3x3 Circular Grid Container --- */
/* --- Grid Container (3 Columns) --- */
.scales-circle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Increased vertical gap to accommodate the button */
    gap: 20px 30px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    direction: rtl;
    text-align: center;
}

/* --- Individual Item --- */
.scale-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}

/* --- The Circle Wrapper --- */
.circle-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    background: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.circle-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Title Styling --- */
.circle-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    margin: 0 0 15px 0;
    /* Space below title for the button */
    min-height: 2.8em;
    /* Keeps buttons aligned if titles wrap */
    display: flex;
    align-items: center;
    max-width: 340px;
}

/* --- THE BUTTON (Placed after Title) --- */
/* .card-link {
    background-color: #f0fff4;
    color: var(--primary-color);
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-block;
    border: 1px solid #e0f2e0;
} */

/* --- Hover Effects --- */
.scale-item:hover {
    transform: translateY(-8px);
}

.scale-item:hover .circle-wrapper {
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.2);
}

.scale-item:hover .card-link {
    background-color: var(--primary-color);
    color: white;
}

/* --- Mobile View --- */
@media (max-width: 850px) {
    .scales-circle-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}

/* --- Section Header Styling --- */
.section-header {
    text-align: center;
    margin-bottom: 50px;
    direction: rtl;
}

.main-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    /* Your #5A2D82 purple */
    margin-bottom: 10px;
    font-weight: 800;
}

.title-underline {
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    /* Your #0071BC blue */
    margin: 0 auto;
    border-radius: 2px;
}

/* --- Responsive adjustment for the title --- */
@media (max-width: 768px) {
    .main-title {
        font-size: 1.8rem;
    }
}

/* dashboard description design */
/* Dynamic Dashboard Analysis - Theme Aware */
.dashboard-analysis {
    margin-top: 40px;
    background: var(--bg-white);
    /* Automatically uses the theme's primary color for the border */
    border-right: 5px solid var(--primary-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    direction: rtl;
    border: 1px solid var(--border-color);
    border-right: 5px solid var(--primary-color);
}

.analysis-header h3 {
    /* Uses the theme's primary color for the title */
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}
/*Gallery design*/
/* Optional underline for the header */
.analysis-header h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.analysis-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.analysis-item {
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.analysis-item:hover {
    transform: translateY(-3px);
}

.analysis-item h4 {
    /* Uses the theme's secondary color for sub-titles */
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    font-weight: 700;
}

.analysis-icon {
    margin-left: 10px;
    font-size: 1.2rem;
}

.analysis-item p {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 0.95rem;
    text-align: justify;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .analysis-content {
        grid-template-columns: 1fr;
    }
}

/* --- Team Section --- */
.team-section {
    background-color: var(--bg-light);
    padding: 80px 0;
}

.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.team-card {
    background: linear-gradient(135deg, rgba(90, 45, 130, 0.03), rgba(0, 113, 188, 0.03));
    border-radius: 16px;
    /* Removed horizontal padding so image hits the edges */
    padding: 0 0 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-top-color 0.3s ease, background 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    /* This clips the image corners to the card radius */

    flex: 0 1 350px;
    max-width: 100%;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-top: 4px solid var(--accent-gold);
    background: linear-gradient(135deg, rgba(90, 45, 130, 0.06), rgba(0, 113, 188, 0.04));
}

/* Updated: Rectangular Image Container filling the top half */
.member-img-container {
    width: 100%;
    /* Spans full width of the card */
    height: 220px;
    /* Fixed height for the rectangle */
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    background: #f6f7f8;
    background-image: linear-gradient(to right,
            #f6f7f8 0%,
            #edeef1 20%,
            #f6f7f8 40%,
            #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 200% 100%;
    animation: teamShimmer 1.5s linear infinite;
}

@keyframes teamShimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.member-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures the photo fills the rectangle without distorting */

    display: block;
    position: relative;
    z-index: 2;
}

/* Typography Adjustments (adding side padding back for text) */
.member-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    padding: 0 1.5rem;
    /* Padding for text since card padding was removed */
}

.member-role {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1.2rem;
    padding: 0 1.5rem;
}

.member-desc {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 0;
    padding: 0 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.member-desc a {
    color: #1a73e8;       /* Blue color */
    text-decoration: underline; /* Underlined */
    font-weight: bold;     /* Optional: makes it stand out */
}


.read-more-btn {
    margin-top: 1.25rem;
    padding: 0.5rem 1.4rem;
    border-radius: 999px;
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(90, 45, 130, 0.28);
    transform: translateY(-2px);
}

.team-modal-desc {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.8;
    text-align: justify;
    white-space: normal;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .team-card {
        flex: 0 1 100%;
    }

    .member-img-container {
        height: 200px;
        /* Slightly shorter rectangle for mobile */
    }
}


/* For smoth transtion between the beaviour and the main page */
@view-transition {
    navigation: auto;
    /* Enables transition on cross-document navigation */
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.5s;
}



/*  dashboard analysis design */
.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* العنصر بعرض كامل */
.full-width {
    width: 100%;
}

/* صف العمودين */
.analysis-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* كرت التنسيق */
.analysis-item {
    background: #f4f6f8;
    padding: 20px;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .analysis-row {
        grid-template-columns: 1fr;
    }
}


/* Events Section */

.events {
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 10px;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 50px;
    color: #666;
}

/* Slider Layout */
/* Container & Window */
.slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    direction: rtl; /* Ensures RTL flow */
}

.slider-window {
    overflow: hidden;
    width: 100%;
    padding: 20px 0;
}

.slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); /* Smooth "Swoosh" effect */
    gap: 20px;
}

/* Card Styling */
.card {
    min-width: calc(50% - 10px); /* Shows 2 cards at a time minus gap */
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    padding: 15px;
    text-align: center;
    box-sizing: border-box;
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #333;
    height: 40px; /* Keeps titles aligned */
    overflow: hidden;
}

iframe {
    width: 100%;
    border-radius: 10px;
    border: none;
    height: 400px; /* Standard height for X embeds */
}

/* Navigation Buttons */
.nav-btn {
    background: #2c3e50;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: #34495e;
    transform: scale(1.1);
}

/* Mobile Responsive: Show 1 card instead of 2 */
@media (max-width: 768px) {
    .card {
        min-width: 100%;
    }
}