/* Gaza Places - Modern SaaS Theme */
/* Premium Modern UI - Industry Best Practices */

/* ============================================================================ */
/* MODERN SAAS DESIGN SYSTEM */
/* ============================================================================ */
:root {
    /* Spacing Scale: 4px base unit - Industry Standard */
    --spacing-xs: 4px;    /* 1x */
    --spacing-sm: 8px;    /* 2x */
    --spacing-md: 12px;   /* 3x */
    --spacing-lg: 16px;   /* 4x */
    --spacing-xl: 20px;   /* 5x */
    --spacing-2xl: 24px;  /* 6x */
    --spacing-3xl: 32px;  /* 8x */

    /* Typography Scale: Modern, Readable */
    --text-xs: 14px;      /* small labels */
    --text-sm: 15px;      /* body copy, small text */
    --text-base: 16px;    /* default body text */
    --text-lg: 18px;      /* larger body text */
    --text-xl: 20px;      /* section headers */
    --text-2xl: 28px;     /* page headers */
    --text-3xl: 36px;     /* large stats */

    /* Line Heights */
    --leading-tight: 1.3;
    --leading-normal: 1.5;
    --leading-relaxed: 1.6;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Primary Color Palette - Modern Blue */
    --color-primary: #0969da;
    --color-primary-dark: #0860ca;
    --color-primary-light: #ddf4ff;
    --color-primary-lighter: #e0f2fe;
    --color-primary-accent: #b3d9ff;

    /* Neutral Colors - Clean & Modern */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-tertiary: #fafbfc;
    --color-text-primary: #1a202c;
    --color-text-secondary: #64748b;
    --color-border: #e5e7eb;
    --color-border-light: #f0f3f7;

    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #0969da;

    /* Shadows - Professional Depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-focus: 0 0 0 4px rgba(9, 105, 218, 0.1);

    /* Legacy Radzen Compatibility */
    --rz-primary: var(--color-primary);
    --rz-primary-light: var(--color-primary-light);
    --rz-primary-dark: var(--color-primary-dark);
    --rz-success: var(--color-success);
    --rz-warning: var(--color-warning);
    --rz-danger: var(--color-danger);
    --rz-info: var(--color-info);
    --rz-base-background: var(--color-bg-primary);
    --rz-surface: var(--color-bg-primary);
    --rz-border: var(--color-border);
    --rz-border-light: var(--color-border-light);
    --rz-text-primary: var(--color-text-primary);
    --rz-text-secondary: var(--color-text-secondary);
    --rz-shadow-1: var(--shadow-xs);
    --rz-shadow-2: var(--shadow-sm);
    --rz-shadow-3: var(--shadow-md);
    --rz-spacing-1: var(--spacing-sm);
    --rz-spacing-2: var(--spacing-lg);
    --rz-spacing-3: var(--spacing-2xl);
}

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

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-tertiary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Explicit RTL for Arabic */
html[dir="rtl"],
html[dir="rtl"] body,
html[lang="ar"],
html[lang="ar"] body {
    direction: rtl !important;
    text-align: right !important;
}

/* Force RTL on all major containers */
html[dir="rtl"] .container,
html[dir="rtl"] .container-fluid,
html[dir="rtl"] .row,
html[dir="rtl"] .col,
html[dir="rtl"] [class*="col-"],
html[lang="ar"] .container,
html[lang="ar"] .container-fluid,
html[lang="ar"] .row,
html[lang="ar"] .col,
html[lang="ar"] [class*="col-"] {
    direction: rtl !important;
    text-align: right !important;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text-primary);
    margin: 0;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); font-weight: var(--font-semibold); }
h6 { font-size: var(--text-sm); font-weight: var(--font-semibold); }

/* Text Utilities */
.text-lg { font-size: var(--text-lg); }
.text-base { font-size: var(--text-base); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }

.avatar {
    display: inline-flex;
    align-items: center;
    background: var(--rz-border-light);
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 16px;
    text-transform: uppercase;
}

.card-columns {
    column-count: 2;
}

.card-title-custom {
    font-size: 18px !important;
    color: #000 !important;
}

.card-body-custom {
    color: #4b4a4a !important;
    background-color: var(--rz-base-background);
}

.card-body-custom:hover {
    background-color: var(--rz-base-background);
    color: #4b4a4a;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Prevent Leaflet from styling <a> tags globally */
a {
    text-decoration: none !important;
    color: inherit !important;
}

.leaflet-container a {
    text-decoration: none !important;
}

#searchPlaceBtn {
    border-radius: 0px !important;
}

#searchNearbyBtn {
    border-radius-inline-start: 0px !important;
}

.card-custom {
    margin-bottom: 10px !important;
    padding: 0px !important;
    border: 0px !important;
    margin-bottom: 1.75rem !important;
    position: inherit !important;
}

a, .btn-link {
    color: var(--rz-primary) !important;
}

a.active.nav-link {
    color: #fff !important;
}

.btn-primary0, .bg-primary0 {
    color: #000 !important;
    background-color: #d3e3fd !important;
    border-color: #d3e3fd !important;
}

.btn-primary0:hover,
.bg-primary0:hover {
    color: #fff !important;
    background-color: #d3e3fd !important;
    border-color: #d3e3fd !important;
}

.bi-patch-check-fill {
    color: #0d6efdd9 !important;
}

h1 {
    font-family: 'Noto Sans Arabic', sans-serif !important;
    font-weight: 1000;
}

a {
    color: #17a2b8;
}

/* Container and Sidebar Styles */
.container {
    height: 100%;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

.container-fluid {
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh;
    position: relative;
}

.leaflet-popup-content {
    width: 400px !important;
}

/* Map Styles - Full screen with left panel on top */
#map {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: row;
    margin: 0;
    padding: 0;
}

/* Leaflet map container - fills parent */
#leaflet-map {
    width: 100%;
    height: 100%;
    position: relative;
}

.leaflet-container a {
    color: #17a2b8;
}

/* Selected Polygon Map Styles */
.selected-polygon-map-container {
    display: none;
    margin-bottom: 15px;
}

.selected-polygon-map {
    height: 200px;
}

/* Image Styles */
.selected-polygon-image {
    height: 118px;
    margin-bottom: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.selected-polygon-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
}

/* Top Bar Styles */
.top-left a {
    text-decoration: none;
    color: black;
}

/* Loading Label Styles */
.loading-label {
    font-size: 16px;
    margin-bottom: 10px;
}

/* Badge Styles */
.selected-polygon-image .badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    margin-left: 10px;
}

/* Modal Styles */
#modalImage {
    width: 50%;
}

.modal-body {
    overflow-y: auto;
}

/* Selected Images Styles */
#selectedImages {
    height: 200px;
    overflow-y: auto;
}

/* Additional Container Styles */
.container2 {
    display: flex;
    height: 100%;
}

/* Actions Styles */
.actions {
    padding: 5px;
    padding-top: 15px;
    background-color: var(--rz-border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-circle {
    width: 40px;
    height: 40px;
    margin: 5px;
    padding: 5px;
    border-radius: 50%;
    text-align: center;
    font-size: 18px;
    line-height: 1.42857;
}

/* Map Styles */
.map {
    flex: 1;
}

/* Separator Styles */
.separator {
    border: 0;
    height: 1px;
    margin: 20px 0;
    background: #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Modal Styles (additional) */
.modal-body {
    overflow-y: auto;
}

#modalImage {
    width: auto;
    margin-bottom: 20px;
}

#modalImageDetails {
    max-height: 50vh;
    overflow-y: auto;
}

/* Container Fluid Styles */
.container-fluid {
    height: 100%;
}

.row-full-height {
    height: 100%;
}

/* Vertical Bar Styles */
.vertical-bar {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--rz-base-background);
}

/* ============================================================================ */
/* LEFT PANEL - VERTICAL STACK LAYOUT */
/* ============================================================================ */
.map-left {
    width: 50%;
    height: 100vh;
    z-index: 100;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background: white;
    flex-shrink: 0;
    overflow: hidden;
}

.map-right {
    width: 50%;
    height: 100vh;
    padding: 0;
    overflow: hidden;
    margin: 0;
    flex-shrink: 0;
}

/* 1. HEADER SECTION - Sticky at top */
#top-bar {
    padding: var(--spacing-md);
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 150;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.logo-section img {
    flex-shrink: 0;
}

.site-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.title-text {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    margin: 0;
    color: var(--color-text-primary);
}

.subtitle-text {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.header-actions {
    margin-left: auto;
    flex-shrink: 0;
}

.header-actions .btn {
    padding: var(--spacing-xs) var(--spacing-lg);
    font-size: var(--text-sm);
}

.about-link-topbar {
    margin-left: auto;
    flex-shrink: 0;
}

.about-link-topbar .btn {
    padding: var(--spacing-xs) var(--spacing-lg);
    font-size: var(--text-sm);
}

/* 2. SEARCH BAR SECTION */
#search-bar-section {
    padding: var(--spacing-md);
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

#search-bar-section .autocomplete-container {
    width: 100%;
}

/* 3. STORY TYPE SECTION (with integrated category filter) */
#story-type-section {
    padding: 0 var(--spacing-md);
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    overflow-x: auto;
}

#story-type-section .rz-tabview {
    width: 100%;
}

#story-type-section #story-type-options {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: none;
}

#story-type-section .rz-tabview-nav-item {
    flex-shrink: 0;
}

#story-type-section .rz-tabview-nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--text-base); /* 16px - consistent with app base size */
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#story-type-section .rz-tabview-nav-link:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-primary);
}

#story-type-section .rz-tabview-nav-link.rz-state-active,
#story-type-section .rz-tabview-nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background-color: transparent;
}

/* Category dropdown within tabs */
#story-type-section .rz-tabview-nav-item-dropdown {
    position: relative;
}

#story-type-section .rz-tabview-nav-item-dropdown .dropdown {
    display: flex;
    align-items: center;
}

#story-type-section .rz-tabview-nav-item-dropdown .dropdown-toggle::after {
    margin-left: 0.5rem;
}

#story-type-section .rz-tabview-nav-item-dropdown .dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
}

#story-type-section .rz-tabview-nav-item-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-base); /* 16px - consistent with app base size */
    transition: all 0.2s ease;
}

#story-type-section .rz-tabview-nav-item-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
}

#story-type-section .rz-tabview-nav-item-dropdown .dropdown-item:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-primary);
}

#story-type-section .rz-tabview-nav-item-dropdown .dropdown-item.active {
    background-color: var(--color-primary);
    color: white;
}

/* 5. MAIN CONTENT SECTION - Stories Grid */
#main-content-section {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--color-bg-tertiary);
}

#main-content-section .alert {
    margin: var(--spacing-md);
}

#main-content-section #featured-places {
    margin: var(--spacing-md);
}

#main-content-section #displayResults {
    padding: var(--spacing-md);
}

/* 6. BOTTOM FOOTER - Sticky at bottom */
#bottom-bar {
    position: sticky;
    bottom: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
    min-height: 48px;
    z-index: 140;
}

/* ============================================================================ */
/* RESPONSIVE DESIGN - Mobile & Tablet */
/* ============================================================================ */

/* Tablet devices */
@media (max-width: 992px) {
    .map-left {
        width: 100%;
    }

    .map-right {
        display: none;
    }

    #top-bar {
        padding: var(--spacing-sm);
    }

    .header-content {
        gap: var(--spacing-sm);
    }

    .logo-section img {
        width: 40px;
    }

    .title-text {
        font-size: var(--text-sm);
    }

    .subtitle-text {
        font-size: 11px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    #top-bar {
        padding: var(--spacing-sm);
    }

    .header-content {
        flex-wrap: wrap;
    }

    .header-actions {
        width: 100%;
        margin-left: 0;
        margin-top: var(--spacing-sm);
    }

    .header-actions .btn {
        width: 100%;
    }

    #search-bar-section {
        padding: var(--spacing-sm);
    }

    #story-type-section {
        padding: 0 var(--spacing-sm);
    }

    #main-content-section #displayResults {
        padding: var(--spacing-sm);
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    #bottom-bar {
        flex-direction: column;
        min-height: auto;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    #main-content-section #displayResults {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .logo-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .site-title {
        display: none;
    }
}

.tab-head {
    padding: 15px;
}

/* Autocomplete Styles - Updated for new layout */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-container .input-group {
    display: flex;
    width: 100%;
}

/* LTR: Input rounded on left */
html[dir="ltr"] .autocomplete-container .form-control {
    flex: 1;
    height: 40px;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-sm);
    border: 1px solid var(--color-border);
    border-radius: 6px 0 0 6px;
}

/* RTL: Input rounded on right */
html[dir="rtl"] .autocomplete-container .form-control {
    flex: 1;
    height: 40px;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-sm);
    border: 1px solid var(--color-border);
    border-radius: 6px 0 0 6px;
}

.autocomplete-container .input-group-append {
    display: flex;
}

.autocomplete-container .btn {
    height: 40px;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-sm);
    border: 1px solid var(--color-border);
}

/* LTR: Middle button no radius, no left border */
html[dir="ltr"] .autocomplete-container .btn:first-child {
    border-radius: 0;
    border-left: none;
}

/* RTL: Middle button no radius, no right border */
html[dir="rtl"] .autocomplete-container .btn:first-child {
    border-radius: 0;
    border-right: none;
}

/* LTR: Last button rounded on right */
html[dir="ltr"] .autocomplete-container .btn:last-child {
    border-radius: 0 6px 6px 0;
}

/* RTL: Last button rounded on left */
html[dir="rtl"] .autocomplete-container .btn:last-child {
    border-radius: 0 6px 6px 0;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-top: none;
    background-color: #fff;
    display: none;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-results a {
    display: block;
    padding: 6px 10px;
    color: #333;
    text-decoration: none;
    font-weight: 400;
}

.autocomplete-results a:hover {
    background-color: var(--rz-base-background);
}

.search-result-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--rz-border-light);
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 400;
}

.search-result-item:hover {
    background-color: var(--rz-base-background);
    color: var(--rz-primary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item strong {
    display: block;
    color: #333;
    font-weight: 600;
}

.search-result-item small {
    display: block;
    color: #999;
    font-size: var(--text-base); /* 16px - consistent with app base size */
    margin-top: 4px;
}

/* Modern Card Component */
.card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.card:hover {
    border-color: var(--color-primary-accent);
    box-shadow: var(--shadow-md);
}

.card:hover {
    cursor: pointer;
}

.user-info {
    margin-top: 0;
    margin: 10px;
    padding: 0px;
}

/* Legacy styles - kept for compatibility */
.svg-container img {
    background-color: var(--rz-base-background);
}

/* Footer links container */
.footer-links {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-xs);
    align-items: center;
    flex: 1;
}

#bottom-bar a {
    font-size: var(--text-xs);
    padding: 0 var(--spacing-xs);
    white-space: nowrap;
}

#bottom-bar .btn-link {
    text-decoration: none;
}

#bottom-bar .btn-link:hover {
    text-decoration: underline;
}

#bottom-bar a.disabled-link {
    color: #6c757d;
    pointer-events: none;
}

#bottom-bar .dropdown {
    flex-shrink: 0;
}

#bottom-bar .dropdown button {
    font-size: var(--text-base); /* 16px - same as body text */
    padding: var(--spacing-xs) var(--spacing-sm);
}

.modal {
    z-index: 100001;
}

.modal-backdrop {
    z-index: 100000;
}

.footer {
    font-size: 0.92rem;
}

#upload-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#uploadMessage {
    margin: 15px;
}

.dropdown-item {
    font-size: var(--text-base); /* 16px - consistent with app base size */
    padding: 10px;
}

.custom-modal-width {
    max-width: 100%;
    margin: 3%;
}

#city-dropdown {
    max-height: 400px;
    overflow-y: scroll;
}

.form-group.hidden {
    display: none;
}

.left-section {
    display: flex;
    align-items: center;
}

.table td, .table th {
    padding: 5px;
    border: 1;
}

#centered-content h4,
#centered-content p,
#centered-content a {
    margin: 0;
    color: black;
    padding: 0;
}

.right-section {
    display: flex;
    align-items: center;
}

.right-section > * {
    margin-left: 10px;
}

#loader {
    padding: 10px;
}

.autocomplete-results-map {
    max-height: 120px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
}

.autocomplete-results-map div {
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 400;
}

.autocomplete-results-map div:hover {
    background-color: #f1f1f1;
}

#title1 a {
    font-weight: bold;
    font-size: 18px;
    padding-bottom: 0px;
    margin-bottom: -7px;
}

#title2 {
    margin-top: -5px !important;
    font-size: var(--text-base); /* 16px - consistent with app base size */
    color: grey;
}

.not-italic {
    font-style: normal;
}

.popup-content {
    text-align: center;
    font-family: Arial, sans-serif;
}

.story-count {
    font-size: 24px;
    padding: 12px;
}

#uploadModalMap {
    position: static;
    height: 400px;
}

#projectModalMap {
    position: static;
    height: 400px;
}

.map-area {
    position: relative;
    background: transparent;
    height: 400px;
}

#MapMapLoader {
    position: absolute;
    font-size: var(--text-base); /* 16px - consistent with app base size */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.8);
    padding: 20px;
    z-index: 1000000000;
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

.image-count-cluster-level1 {
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    opacity: 0.9;
}

.image-count-cluster-level2 {
    background-color: orange;
    color: white;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    opacity: 0.9;
}

.image-count-cluster-level3 {
    background-color: green;
    color: white;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    opacity: 0.9;
}

.image-count-cluster:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.marker-cluster-small .image-count-cluster {
    width: 40px;
    height: 40px;
    line-height: 40px;
}

/* Custom CSS to remove padding and margins */
.no-gutters {
    margin: 0;
    padding: 0;
}

.no-gutters > .col,
.no-gutters > [class^="col-"] {
    padding: 0;
}

.image-container {
    position: relative;
    border-color: rgba(192, 192, 192, 0.5);
    border-style: dashed;
    border-width: 1px;
    width: 100%;
    padding-top: 100%;
    align-items: center;
}

.image-container img,
.image-container .fallback-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow-y: auto;
}

.fallback-text {
    display: flex;
    color: gray;
    font-size: 16px;
    padding: 10px;
    cursor: pointer;
}

.fallback-text a {
    display: flex;
    font-size: 16px;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
}

.fallback-text a:hover {
    color: #000;
}

.image-container-center {
    text-align: center;
}

.tell-story {
    font-size: 16px;
    color: #333;
}

#imagePreviewContainer {
    height: 300px;
    padding: 10px;
    width: 100%;
    overflow-y: scroll;
    overflow-x: scroll;
    border: 1px dashed #e0e0e0;
}

.form-check-label {
    width: 100%;
}

.formItemContainer {
    padding: 10px;
    width: 100%;
    border: 1px dashed #e0e0e0;
}

#imagePreviewContainer .btn {
    margin: 5px;
}

#clearImageButton {
    position: absolute;
    top: 0;
    right: 0;
}

.step-circle {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #17a2b8;
    color: white;
    text-align: center;
    line-height: 22px;
    font-weight: bold;
    margin-right: 5px;
    font-size: 12px;
}

#content-left {
    margin: 30px;
}

.collapsed {
    display: none;
}

.expanded {
    display: block;
}

.disabled-link {
    color: #6c757d !important;
    text-decoration: none;
    cursor: not-allowed;
    pointer-events: none;
}

.place-info {
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: .25rem;
    padding: 15px;
}

#edit-section.hidden {
    display: none;
}

.story-details {
    /* padding: 15px; */
    /* max-height: 540px; */
    /* overflow-y: auto; */
}

.story-image {
    overflow-y: auto;
}

.social-media-group {
    width: 100%;
}

#btn-support-project {
    position: absolute;
    right: 25px;
    pointer-events: auto;
    z-index: 10000000;
}

#key-places {
    position: absolute;
    bottom: 0;
    margin: 28px;
    left: auto;
    right: 25px;
    pointer-events: auto;
    z-index: 10000000;
}

.key-place {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

#searchResultsMap {
    display: none;
}

.dropdown-toggle-card::after {
    display: none;
}

.dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    z-index: 10222250;
    position: absolute;
}

#groups-content {
    display: flex;
    overflow-x: scroll;
    white-space: nowrap;
    padding: 10px;
}

.square {
    width: 100px;
    height: 100px;
    background-color: var(--rz-base-background);
    border: 1px solid #dee2e6;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.square img {
    max-width: 80%;
    max-height: 80%;
}

.translate-link {
    float: right;
    padding: 0px;
}

/* Legacy story type options styles - removed, see new layout above */

/* ============================================================================ */
/* CATEGORY NAVIGATION - Radzen Secondary Tabs Style */
/* ============================================================================ */

/* Container for horizontal scrolling nav */
.nav-categories-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    padding-inline-start: 0;
    padding-inline-end: 0;
    margin-bottom: 1rem;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
    list-style: none;
}

/* Individual nav items - don't wrap */
.nav-categories-scroll .nav-item {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Nav links - Radzen Secondary Tab Style */
.nav-categories-scroll .nav-link {
    padding: 6px 16px;
    font-size: var(--font-size-sm);
    font-weight: var(--rz-font-weight-medium);
    border-radius: var(--rz-border-radius);
    border: 1px solid var(--rz-border);
    background-color: var(--rz-surface);
    color: var(--rz-text-secondary);
    transition: all 0.2s ease;
}

.nav-categories-scroll .nav-link:hover {
    background-color: var(--rz-border-light);
    border-color: var(--rz-primary);
    color: var(--rz-primary);
}

.nav-categories-scroll .nav-link.active {
    background-color: var(--rz-primary);
    color: white;
    border-color: var(--rz-primary);
}

/* Scrollbar styling for categories */
.nav-categories-scroll::-webkit-scrollbar {
    height: 4px;
}

.nav-categories-scroll::-webkit-scrollbar-track {
    background: var(--rz-border-light);
    border-radius: 2px;
}

.nav-categories-scroll::-webkit-scrollbar-thumb {
    background: var(--rz-border);
    border-radius: 2px;
}

.nav-categories-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--rz-text-secondary);
}

.border-inline-start-0 {
    border-inline-end: 0;
}

.table30 td {
    width: 30vw;
    max-width: 100px;
    max-height: 100px;
    vertical-align: middle;
    cursor: pointer;
    padding: 5px;
}

.table30 td :hover {
    background: var(--rz-base-background);
}

.form-check {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Media queries for smaller screens */
@media (max-width: 768px) {
    .table30 td {
        width: 40vw;
        height: 40vw;
    }
}

@media (max-width: 576px) {
    .table30 td {
        width: 50vw;
        height: 50vw;
    }
}

.select-city-div {
    position: absolute;
    bottom: 0;
    margin: 28px;
    left: auto;
    right: 25px;
    pointer-events: auto;
    z-index: 1000;
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.main-image {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.text-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    padding: 25px;
}

.main-title {
    margin: 0;
    font-size: 28px;
}

.secondary-title {
    margin: 0;
    font-size: 18px;
}

.visit-link {
    margin-top: 15px;
    margin-bottom: 0px;
}

.loader {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.custom-font {
    font-family: 'Noto Sans Arabic', sans-serif !important;
}

/* Summernote editor styles */
.note-btn {
    background-color: #fff;
    color: black;
    font-family: 'Noto Sans Arabic', sans-serif !important;
    font-size: 16px;
}

.note-toolbar {
    background-color: #fff;
    border: 1px solid #ddd;
}

/* Instagram post-sized div */
#postDiv {
    width: 180px;
    height: 180px;
    background-image: url('');
    background-size: cover;
    background-position: center;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    text-align: left;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Transparent black background for text overlay */
#textOverlay {
    background-image: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.15));
    width: 100%;
    padding: 140px;
    padding-top: 32%;
}

/* Title styling */
#title {
    font-size: 74px;
    letter-spacing: 2.5px;
}

/* Description styling */
#description {
    font-size: 55px;
    margin-top: 10px;
    line-height: 1.35;
    letter-spacing: 1.8px;
}

#details {
    font-size: 31px;
    margin-top: 50px;
    letter-spacing: 1.8px;
    display: flex;
    justify-content: space-between;
}

#details .left {
    letter-spacing: 1.8px;
    text-align: left;
    flex: 1;
}

#details .right {
    letter-spacing: 1.8px;
    text-align: right;
}

/* Style the button */
#captureButton {
    padding: 20px 40px;
    background-color: #2C7CC3;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    border-radius: 5px;
}

#captureButton:hover {
    background-color: #1d5b8f;
}

/* Hidden div to append the captured image */
#parent {
    margin-top: 30px;
    text-align: center;
}

/* Style for the download button */
#downloadButton {
    padding: 20px 40px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    border-radius: 5px;
}

#downloadButton:hover {
    background-color: #218838;
}

/* Apply scrolling to dropdown menus on small screens */
@media (max-width: 767px) {
    .dropdown-menu {
        max-height: 200px;
        overflow-x: auto;
    }
}

.dropdown-toggle-split {
    text-decoration: auto;
}

.close {
    background: none;
    border: none;
}

.close:hover {
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
}

.input-group-append {
    display: flex;
    gap: 0;
}

.input-group-append .btn {
    margin-right: 0;
}

.custom-obj-alert {
    border-radius: 0px !important;
    background: #eef5ff;
}

#ViewPlaceProjectsModal #modalTitle,
#cardModal #modalTitle,
#ViewProjectModal #modalTitle,
#rebuildModal #modalTitle,
#modalTitle {
    padding: 0px;
}

.story-footer a:hover {
    text-decoration: underline !important;
}

/* RTL-specific styles */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body,
html[dir="rtl"] p,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    text-align: right !important;
}

html[dir="rtl"] .text-right {
    text-align: right;
}

html[dir="rtl"] .container {
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
}

html[dir="rtl"] .select-city-div {
    right: auto;
    left: 40px;
    margin: 13px;
}

html[dir="rtl"] .dropdown-menu {
    direction: rtl;
}

html[dir="rtl"] .form-checkbox {
    margin-left: 15px;
    padding-right: 1.25rem;
}

html[dir="rtl"] .form-check {
    padding-right: 1.25rem;
}

html[dir="rtl"] .form-check .form-check-input {
    margin-right: -1.5em;
}

html[dir="rtl"] .modal-dialog {
    direction: rtl;
}

html[dir="rtl"] .modal-content {
    text-align: right;
}

html[dir="rtl"] .alert .close {
    margin-left: auto !important;
    margin-left: 0 !important;
    float: left;
}

html[dir="rtl"] .form-group {
    direction: rtl;
}

html[dir="rtl"] .form-group label {
    text-align: right;
}

html[dir="rtl"] .form-control {
    text-align: right;
}

html[dir="rtl"] .form-check-label {
    text-align: right;
}

html[dir="rtl"] .form-check-inline .form-check-input {
    margin-right: -1.5rem !important;
}

html[dir="rtl"] .modal-header .close {
    position: absolute;
    left: 0;
    right: auto;
}

/* RTL: Search input rounded on right, flat on left */
html[dir="rtl"] #searchInput {
    border-radius: 6px 0 0 6px !important;
}

/* RTL: Nearby button (last button) rounded on left, flat on right */
html[dir="rtl"] #searchNearbyBtn {
    border-radius: 0 6px 6px 0 !important;
}

/* RTL: Go button (middle button) - no radius */
html[dir="rtl"] #searchPlaceBtn {
    border-radius: 0 !important;
    border-right: none !important;
}

/* RTL: Map loading indicator - align to left (start) */
html[dir="rtl"] #MapMapLoader {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
    padding-left: 20px !important;
    padding-top: 20px !important;
}

html[dir="rtl"] .dropdown-menu {
    text-align: right;
}

html[dir="rtl"] .autocomplete-container-map {
    top: 100%;
    left: 0;
}

/* LTR: Search input rounded on left, flat on right */
html[dir="ltr"] #searchInput {
    border-radius: 6px 0 0 6px !important;
}

/* LTR: Nearby button (last button) rounded on right, flat on left */
html[dir="ltr"] #searchNearbyBtn {
    border-radius: 0 6px 6px 0 !important;
}

/* LTR: Go button (middle button) - no radius */
html[dir="ltr"] #searchPlaceBtn {
    border-radius: 0 !important;
    border-left: none !important;
}

html[dir="ltr"] .autocomplete-container-map {
    top: 10px;
    left: 10px;
    width: 70%;
    max-width: 500px;
}

html[dir="rtl"] #centered-content {
    text-align: right !important;
    margin-right: 0px !important;
}

html[dir="rtl"] .image-container {
    text-align: right !important;
}

html[dir="rtl"] .translate-link {
    float: left;
}

/* ============================================================================
   UTILITY CLASSES - Consolidated from inline styles
   ============================================================================ */

/* Title with forced black color (overrides text-white) */
.title-black {
    color: #000 !important;
}

/* Hidden by default */
.initially-hidden {
    display: none;
}

/* No-wrap text (prevents word wrapping) */
.text-nowrap-flex {
    white-space: nowrap;
}

/* ============================================================================ */
/* STORIES CSS GRID DISPLAY */
/* ============================================================================ */

/* Stories Grid Container - Updated for new layout */
#displayResults {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Modern Story Card Component */
.story-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    position: relative;
    padding: 0;
}

.story-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-primary);
}

/* Stacked Cards Effect - Shows when multiple stories exist */
.story-card.has-multiple {
    position: relative;
}

/* Story count badge for stacked cards */
.story-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(9, 105, 218, 0.95);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.story-count-badge i {
    font-size: 12px;
}

/* Story card image section (top - NO PADDING) */
.story-card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    position: relative;
}

.story-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #999;
}

/* Story card info section (middle) */
.story-card-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px;
    background: white;
    gap: 8px;
}

/* Story card title */
.story-card-title {
    margin: 0;
    color: var(--rz-text-primary);
    font-size: var(--text-base); /* 16px - consistent with app base size */
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Story card highlight */
.story-card-highlight {
    margin: 0;
    padding: 0;
    color: #555;
    font-size: var(--text-base); /* 16px - consistent with app base size */
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Story location */
.story-card-location {
    color: #666;
}

/* Story location link */
.story-location-link {
    color: var(--rz-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    word-break: break-word;
}

.story-location-link:hover {
    color: var(--rz-primary-dark);
    text-decoration: underline;
}

/* Story card footer - Author and Date */
.story-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border-light);
    color: #666;
}

.story-separator {
    color: #ddd;
}

/* Story author link in footer */
.story-card-footer .story-author-link {
    color: var(--rz-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    word-break: break-word;
}

.story-card-footer .story-author-link:hover {
    color: var(--rz-primary-dark);
    text-decoration: underline;
}

/* Story date/time in footer */
.story-card-date {
    color: #999;
}

/* Pagination controls - container divs */
#paginationTop,
#paginationBottom {
    width: 100%;
    margin-bottom: 0;
}

/* Pagination in footer - compact inline */
#paginationBottom {
    position: relative;
    background: transparent;
    padding: 0;
    margin: 0;
    width: auto;
    flex-shrink: 0;
}

/* Pagination controls - compact inline */
.pagination-controls {
    width: auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--spacing-md);
}

.pagination-info {
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.pagination-buttons {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.pagination-buttons button {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--text-xs);
    height: 32px;
    min-width: auto;
}

/* Responsive grid for tablets (992px) */
@media (max-width: 992px) {
    #displayResults {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .story-card-image {
        height: 180px;
    }

    .story-card-title {
        font-size: 15px; /* Tablets use 15px */
    }

    .story-card-highlight {
        font-size: 13px;
    }

    .story-card-meta-compact {
        font-size: var(--font-size-xs);
    }
}

/* Responsive grid for mobile (768px) */
@media (max-width: 768px) {
    #displayResults {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .story-card-image {
        height: 160px;
    }

    .story-card-info {
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .story-card-title {
        font-size: 15px; /* Mobile uses 15px */
        font-weight: 600;
        -webkit-line-clamp: 2;
    }

    .story-card-highlight {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .story-card-meta-compact {
        font-size: var(--font-size-xxs);
    }

    .story-card-date {
        font-size: var(--font-size-xxs);
    }

    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination-buttons {
        width: 100%;
    }

    .pagination-buttons button {
        flex: 1;
    }

    #bottom-bar {
        flex-direction: column;
        min-height: auto;
        max-height: none;
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #displayResults {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .story-card-image {
        height: 150px;
    }

    .story-card-info {
        padding: 0.4rem;
        gap: 0.2rem;
    }

    .story-card-title {
        font-size: 14px; /* Small phones use 14px */
        font-weight: 600;
        -webkit-line-clamp: 2;
        line-height: 1.3;
    }

    .story-card-highlight {
        font-size: 12px;
        -webkit-line-clamp: 2;
        line-height: 1.3;
    }

    .story-card-meta-compact {
        font-size: var(--font-size-xxs);
    }

    .story-card-date {
        font-size: 11px; /* Extra small for tiny screens */
    }

    .pagination-buttons {
        width: 100%;
    }

    .pagination-buttons button {
        flex: 1;
        font-size: 14px;
    }
}

/* ============================================================================ */
/* STORY DETAILS FULL-SCREEN MODAL */
/* ============================================================================ */

/* Modal Header */
#storyDetailsModal .modal-header {
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-lg) var(--spacing-2xl);
}

#storyDetailsModal .modal-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

/* Modal Body */
#storyDetailsModal .modal-body {
    padding: 0;
    background: var(--color-bg-tertiary);
    overflow: hidden; /* Disable scrollbar on modal body itself */
}

/* Main Container - 3 Column Layout (3:6:3 ratio) */
.story-details-container {
    display: grid;
    grid-template-columns: 3fr 6fr 3fr;
    gap: 0;
    height: 100%;
    min-height: calc(100vh - 120px);
}

/* Left Column - Image and Map (3 parts) */
.story-details-left {
    background: var(--color-bg-secondary);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    overflow-y: auto;
    border-right: 1px solid var(--color-border);
}

.story-details-image-container {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.story-details-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

.story-details-map-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-height: 250px;
}

.story-details-map {
    width: 100%;
    height: 250px;
}

/* Middle Column - Story Content (6 parts) */
.story-details-right {
    background: var(--color-bg-primary);
    padding: var(--spacing-2xl);
    overflow-y: auto;
    border-right: 1px solid var(--color-border);
}

.story-details-info {
    max-width: 100%;
}

/* Right Column - Information Table (3 parts) */
.story-details-sidebar {
    background: var(--color-bg-primary);
    padding: var(--spacing-lg);
    overflow-y: auto;
}

/* Simple Information Table */
.story-info-table {
    width: 100%;
    border-collapse: collapse;
}

.story-info-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
}

.story-info-table tbody tr:last-child {
    border-bottom: none;
}

.story-info-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    vertical-align: top;
}

.story-info-table td.label {
    width: 35%;
    text-align: right;
    padding-right: var(--spacing-lg);
}

.story-info-table td.value {
    word-wrap: break-word;
    word-break: break-word;
}

.story-info-table td.value a {
    color: var(--color-primary);
    text-decoration: none;
}

.story-info-table td.value a:hover {
    text-decoration: underline;
}

/* Hide rows that have no data */
.story-info-table tbody tr[style*="display: none"] {
    display: none;
}

/* Section Styling */
.story-details-section {
    margin-bottom: var(--spacing-3xl);
    padding-bottom: var(--spacing-2xl);
    border-bottom: 1px solid var(--color-border);
}

.story-details-section:last-child {
    border-bottom: none;
}

.story-details-section h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Main Title */
.story-details-main-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    margin: 0;
    line-height: var(--leading-tight);
}

/* Meta Information - Compact Modern Style */
.story-details-meta-compact {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
}

.story-details-meta-line {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
}

.story-details-meta-line .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.story-details-meta-line .meta-item i {
    font-size: 13px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.story-details-meta-line .meta-separator {
    color: var(--color-text-secondary);
    opacity: 0.5;
    padding: 0 4px;
}

.story-details-meta-line a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.story-details-meta-line a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Legacy meta item styling (for other sections) */
.story-meta-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.story-meta-item i {
    width: 20px;
    color: var(--color-primary);
    margin-top: 2px;
    flex-shrink: 0;
}

.story-meta-item strong {
    color: var(--color-text-primary);
    font-weight: var(--font-medium);
}

.story-meta-item a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.story-meta-item a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Story Content */
.story-details-content {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Modal Footer */
#storyDetailsModal .modal-footer,
#addStoryModal .modal-footer {
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-lg) var(--spacing-2xl);
}

/* Add Story Modal - Photo Upload */
.photo-upload-section {
    background: var(--color-bg-secondary);
    padding: var(--spacing-lg);
    border-radius: 8px;
}

.photo-upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--color-bg-primary);
}

.photo-upload-zone:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-lighter);
}

.photo-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.search-dropdown {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-top: none;
    background: var(--color-bg-primary);
    box-shadow: var(--shadow-md);
    border-radius: 0 0 8px 8px;
    display: none;
}

.search-dropdown.show {
    display: block;
}

.search-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--color-border-light);
}

.search-dropdown-item:hover {
    background: var(--color-bg-secondary);
}

.required-field::after {
    content: " *";
    color: var(--color-danger);
}

/* Quill Editor Styling for Add Story Modal */
#addStoryDescriptionEditor {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-primary);
}

#addStoryDescriptionEditor .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    border-radius: 8px 8px 0 0;
}

#addStoryDescriptionEditor .ql-container {
    border: none;
    font-size: var(--text-base);
    min-height: 200px;
}

#addStoryDescriptionEditor .ql-editor {
    min-height: 200px;
    padding: var(--spacing-md);
}

#addStoryDescriptionEditor .ql-editor.ql-blank::before {
    color: var(--color-text-secondary);
    font-style: normal;
}

/* Responsive Design - Story Details Modal */
@media (max-width: 1200px) {
    /* Stack sidebar below on medium screens */
    .story-details-container {
        grid-template-columns: 3fr 6fr;
    }

    .story-details-sidebar {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .sidebar-section {
        flex: 1 1 calc(33.333% - var(--spacing-md));
        min-width: 250px;
    }
}

@media (max-width: 992px) {
    /* Single column layout on tablets */
    .story-details-container {
        grid-template-columns: 1fr;
    }

    .story-details-left,
    .story-details-right,
    .story-details-sidebar {
        padding: var(--spacing-lg);
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .story-details-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }

    .story-details-main-title {
        font-size: var(--text-xl);
    }

    .story-details-sidebar {
        flex-direction: row;
        gap: var(--spacing-md);
    }

    .sidebar-section {
        flex: 1 1 calc(33.333% - var(--spacing-md));
        min-width: 200px;
    }
}

@media (max-width: 576px) {
    #storyDetailsModal .modal-header,
    #storyDetailsModal .modal-footer {
        padding: var(--spacing-md);
    }

    .story-details-left,
    .story-details-right,
    .story-details-sidebar {
        padding: var(--spacing-md);
    }

    .story-details-left {
        grid-template-columns: 1fr;
    }

    .story-details-section {
        margin-bottom: var(--spacing-2xl);
        padding-bottom: var(--spacing-lg);
    }

    .story-details-main-title {
        font-size: var(--text-lg);
    }

    .story-details-sidebar {
        flex-direction: column;
    }

    .sidebar-section {
        flex: 1 1 auto;
        min-width: 100%;
    }
}

/* Loading State */
.story-details-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
}

/* Hidden sections when no data */
.story-details-section.hidden {
    display: none;
}

/* ============================================================================ */
/* RTL (RIGHT-TO-LEFT) SUPPORT FOR ARABIC */
/* ============================================================================ */

[dir="rtl"],
[lang="ar"] {
    direction: rtl !important;
}

[dir="rtl"] *,
[lang="ar"] * {
    direction: inherit !important;
}

[dir="rtl"] .container,
[dir="rtl"] .container-fluid,
[dir="rtl"] .row,
[lang="ar"] .container,
[lang="ar"] .container-fluid,
[lang="ar"] .row {
    direction: rtl !important;
    text-align: right !important;
}

[dir="rtl"] div,
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] a,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] button,
[dir="rtl"] label,
[lang="ar"] div,
[lang="ar"] p,
[lang="ar"] span,
[lang="ar"] a,
[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] h4,
[lang="ar"] h5,
[lang="ar"] h6,
[lang="ar"] button,
[lang="ar"] label {
    text-align: right !important;
}

/* RTL: Flip margins and paddings */
[dir="rtl"] .me-1,
[dir="rtl"] .me-2,
[dir="rtl"] .me-3 {
    margin-right: 0 !important;
    margin-left: var(--spacing-sm) !important;
}

[dir="rtl"] .ms-1,
[dir="rtl"] .ms-2,
[dir="rtl"] .ms-3 {
    margin-left: 0 !important;
    margin-right: var(--spacing-sm) !important;
}

/* RTL: Story cards */
[dir="rtl"] .story-card-info {
    text-align: right;
}

[dir="rtl"] .story-card-title,
[dir="rtl"] .story-card-highlight,
[dir="rtl"] .story-card-description {
    text-align: right;
}

/* RTL: Story count badge */
[dir="rtl"] .story-count-badge {
    right: auto;
    left: 8px;
}

/* RTL: Navigation and buttons */
[dir="rtl"] .btn-group {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header-actions {
    margin-right: auto;
    margin-left: 0;
}

/* RTL: Dropdowns and search */
[dir="rtl"] .autocomplete-results,
[dir="rtl"] .search-dropdown {
    text-align: right;
}

/* ============================================================================ */
/* ADD STORY MODAL STYLES (matching dw/add.php design) */
/* ============================================================================ */

.photo-upload {
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.photo-upload:hover {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.photo-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 0.375rem;
    margin-top: 1rem;
}

.story-item {
    transition: background-color 0.3s ease;
}

.delete-icon {
    cursor: pointer;
    color: #dc3545;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.delete-icon:hover {
    color: #b02a37;
}

.edit-icon {
    cursor: pointer;
    color: #0d6efd;
    font-size: 1.2em;
    margin-left: 0.5rem;
    margin-right: 0;
    transition: color 0.3s ease;
}

.edit-icon:hover {
    color: #0a58ca;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.ql-container {
    height: 220px !important;
}

.alert-fixed {
    position: fixed;
    top: 20px;
    left: 20px;
    right: auto;
    z-index: 9999;
    min-width: 300px;
}

.search-results-dropdown {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-top: none;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.375rem 0.375rem;
    display: none;
}

.search-results-dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.search-results-dropdown-item:hover {
    background-color: #f0f0f0;
}

.search-results-dropdown.show {
    display: block;
}

/* RTL adjustments for add story modal */
[dir="rtl"] .search-results-dropdown-item {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .alert-fixed {
    left: auto;
    right: 20px;
}

[dir="rtl"] .edit-icon {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .search-dropdown-item {
    text-align: right;
}

/* RTL: Icons */
[dir="rtl"] .fa,
[dir="rtl"] .fas {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* RTL: Pagination */
[dir="rtl"] .pagination-controls {
    flex-direction: row-reverse;
}

/* RTL: Story details modal */
[dir="rtl"] .story-details-meta-line {
    direction: rtl;
}

[dir="rtl"] .meta-item {
    direction: rtl;
}

/* RTL: Form elements */
[dir="rtl"] .form-label,
[dir="rtl"] .form-control,
[dir="rtl"] .form-select,
[dir="rtl"] .form-text {
    text-align: right;
}

/* RTL: Modal */
[dir="rtl"] .modal-header,
[dir="rtl"] .modal-body,
[dir="rtl"] .modal-footer {
    text-align: right;
}

[dir="rtl"] .btn-close {
    margin-left: 0;
    margin-right: auto;
}

/* RTL: Tabs */
[dir="rtl"] .rz-tabview-nav {
    flex-direction: row-reverse;
}

/* RTL: Grid adjustments */
[dir="rtl"] .row {
    direction: rtl;
}

[dir="rtl"] .col-lg-8,
[dir="rtl"] .col-lg-4,
[dir="rtl"] .col-md-6 {
    float: right;
}
