/* Common Styles - Shared between LTR and RTL */

/* CSS Custom Properties */
:root {
    /* Brand Colors */
    --primary-color: #00C896;
    --secondary-color: #666666;
    --dark-sidebar: #2D2D3D;
    --light-bg: #F5F5F5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --white: #FFFFFF;
    
    /* Status Colors */
    --success-color: #00C896;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --live-color: #ff5252;
    --breaking-color: #ff0000;
    
    /* Gray Scale */
    --gray-50: #F5F5F5;
    --gray-100: #EEEEEE;
    --gray-200: #E2E2E2;
    --gray-300: #D0D0D0;
    --gray-400: #AEAEAE;
    --gray-500: #8C8C8C;
    --gray-600: #666666;
    --gray-700: #4D4D4D;
    --gray-800: #333333;
    --gray-900: #212121;
    
    /* Iran colors */
    --iran-primary: #239f40;
    --iran-secondary: #da0000;
    --iran-light: #f0f9f1;
    
    /* Israel colors */
    --israel-primary: #0038b8;
    --israel-secondary: #ffffff;
    --israel-light: #f0f4ff;
    
    /* Source Types */
    --source-official: #3498db;
    --source-independent: #8c8c8c;
    --source-government: #00C896;
      /* Animations */
    --transition-micro: 0.2s ease;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.18);
    --shadow-hover: 0 6px 14px rgba(0, 0, 0, 0.12);
    
    /* Spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 20px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    font-size: var(--font-size-md);
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity var(--transition-slow);
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-300);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    color: var(--gray-600);
    font-size: 1.1rem;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* New Layout Structure */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styles */
.app-sidebar {
    width: 320px;
    background: var(--dark-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform var(--transition-normal);
}

.app-sidebar.collapsed {
    transform: translateX(-320px);
}

.sidebar-content {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    background: var(--dark-sidebar);
    color: var(--white);
    padding: var(--space-lg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    flex: 1;
}

.sidebar-title .app-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin: 0;
    color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sidebar-title .app-subtitle {
    font-size: var(--font-size-xs);
    color: var(--gray-300);
    margin: 0.25rem 0 0;
}

.sidebar-toggle {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 5px rgba(0, 200, 150, 0.3);
}

.sidebar-toggle:hover {
    background: #02b086;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 200, 150, 0.4);
}

.sidebar-section {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: var(--space-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    margin: var(--space-sm) var(--space-md);
}

.sidebar-section:last-child {
    border-bottom: none;
    flex: 1;
}

.section-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-300);
    margin: 0 0 var(--space-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 3px solid var(--primary-color);
    padding-left: var(--space-sm);
}

/* Date Picker Section */
.date-picker-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.current-date-display h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--white);
    margin: 0;
}

.current-date-display .date-meta {
    color: var(--gray-300);
    font-size: var(--font-size-xs);
    margin: 0.25rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.date-controls .btn-nav {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--white);
    transition: all var(--transition-micro);
}

.date-controls .btn-nav:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 200, 150, 0.25);
}

.date-controls .btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
}

/* Date picker dropdown */
.date-picker-dropdown {
    padding: 1rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xl);
    border-radius: 12px;
    width: 260px;
    background: white;
}

.btn-date-picker {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 8px var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-micro);
    box-shadow: 0 2px 5px rgba(0, 200, 150, 0.25);
}

.btn-date-picker:hover {
    background: #02b086;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 200, 150, 0.3);
}

/* Ensure dropdown is properly positioned */
.dropdown-menu.date-picker-dropdown {
    display: none;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 0.5rem;
    width: 260px;
    border: none;
}

.dropdown-menu.date-picker-dropdown.show {
    display: block;
}

/* Date picker specific dropdown overrides */
.date-controls .dropdown {
    flex: 1;
    position: relative;
}

/* Ensure calendar fits within dropdown */
.date-picker-dropdown .calendar {
    width: 100%;
}

.date-picker-dropdown .calendar-grid {
    width: 100%;
    min-width: auto;
}

/* Fix dropdown toggle button */
.date-controls .dropdown-toggle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filters Section */
.filters-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0 0 0.75rem;
}

.filter-group .btn-group-vertical .btn {
    text-align: left;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

/* Language Section */
.language-controls .btn {
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
}

/* Language button */
.btn-language {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--white);
    padding: 10px var(--space-md);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-micro);
}

.btn-language:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 200, 150, 0.3);
}

.btn-language i {
    color: var(--primary-color);
}

.btn-language:hover i {
    color: var(--white);
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: 320px;
    background: var(--light-bg);
    min-height: 100vh;
    transition: all var(--transition-normal);
    position: relative;
}

.app-main.expanded {
    margin-left: 0;
}

.main-header {
    background: linear-gradient(to bottom, var(--white), var(--gray-50));
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-content {
    display: flex;
    flex-direction: column;
}

.header-content nav {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.current-date {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-sm);
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.date-icon {
    color: var(--primary-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: var(--font-weight-medium);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    display: inline-block;
    margin: 0 var(--space-xs);
    color: var(--gray-400);
}

.mobile-sidebar-toggle {
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.mobile-sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.desktop-sidebar-toggle {
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    opacity: 0;
    visibility: hidden;
}

.desktop-sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.app-main.expanded .desktop-sidebar-toggle {
    opacity: 1;
    visibility: visible;
}

.main-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0;    background: linear-gradient(90deg, var(--primary-color), var(--primary-color) 70%, #37deb2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.main-content {
    padding: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Timeline */
.timeline-section {
    padding: 2rem 0;
    min-height: 60vh;
}

.timeline-container-new {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
    width: 100%;
    overflow-x: hidden;
}

.timeline-container-new::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--success-color));
    border-radius: 2px;
    transform: translateX(-50%);
}

.timeline-event-new {
    position: relative;
    display: flex;
    margin-bottom: 3rem;
    align-items: center;
}

.timeline-event-new:nth-child(odd) {
    justify-content: flex-end;
}

.timeline-event-new:nth-child(even) {
    justify-content: flex-start;
}

.timeline-event-new::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
    z-index: 2;
    transform: translate(-50%, -50%);
}

.timeline-event-new:nth-child(even)::before {
    background: var(--success-color);
}

.event-card-compact {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    max-width: 400px;
    width: 100%;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    border: 2px solid transparent;
}

.timeline-event-new:nth-child(odd) .event-card-compact {
    margin-right: calc(50% + 2rem);
}

.timeline-event-new:nth-child(even) .event-card-compact {
    margin-left: calc(50% + 2rem);
}

.event-card-compact:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.event-time-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.event-title-compact {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-meta-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.event-countries {
    display: flex;
    gap: 0.5rem;
}

.country-flag-small {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.event-severity-compact {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.event-severity-compact.high {
    background: var(--danger-color);
    color: white;
}

.event-severity-compact.medium {
    background: var(--warning-color);
    color: white;
}

.event-severity-compact.low {
    background: var(--success-color);
    color: white;
}

.event-severity-compact.critical {
    background: var(--breaking-color);
    color: white;
}

/* Breaking News Badge */
.breaking-badge {
    background: linear-gradient(45deg, var(--breaking-color), #ff3333);
    color: white;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* News Section */
.news-section {
    background: var(--gray-50);
    min-height: 100vh;
    padding: 2rem 0 6rem 0; /* Added bottom padding for fixed button */
}

.news-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
}

.news-event-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    text-align: center;
}

.news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.news-country-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.news-country-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.news-country-header.iran {
    background: var(--iran-light);
    color: var(--iran-primary);
    border-bottom: 3px solid var(--iran-primary);
}

.news-country-header.israel {
    background: var(--israel-light);
    color: var(--israel-primary);
    border-bottom: 3px solid var(--israel-primary);
}

.news-articles {
    padding: 0;
}

.news-article {
    padding: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.news-article:last-child {
    border-bottom: none;
}

.news-article:hover {
    background: var(--gray-50);
}

.news-article-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.news-thumbnail-container {
    position: relative;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    background: var(--gray-200);
    transition: opacity var(--transition-fast);
}

.news-thumbnail-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: opacity var(--transition-fast);
}

.news-thumbnail:load + .news-thumbnail-loading {
    opacity: 0;
    pointer-events: none;
}

.thumbnail-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.news-thumbnail-placeholder {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--white);
    font-size: 0.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Country-themed placeholder */
.news-thumbnail-placeholder.country-themed {
    flex-direction: column;
    padding: 4px;
    gap: 2px;
}

.thumbnail-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.thumbnail-flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.thumbnail-initials {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Initials-themed placeholder */
.news-thumbnail-placeholder.initials-themed {
    flex-direction: column;
    gap: 2px;
}

.thumbnail-initials-large {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.thumbnail-source-type {
    font-size: 10px;
    opacity: 0.8;
}

.thumbnail-source-type i {
    width: 10px;
    height: 10px;
}

/* Hover effects for thumbnails */
.news-article:hover .news-thumbnail-container {
    transform: scale(1.05);
    transition: transform var(--transition-fast);
}

.news-article:hover .news-thumbnail-placeholder {
    transform: scale(1.1);
    transition: transform var(--transition-fast);
}

/* Enhanced loading state */
.news-thumbnail-container.loading .news-thumbnail {
    opacity: 0.3;
}

.news-thumbnail-container.loading .news-thumbnail-loading {
    opacity: 1;
}

/* Error state styling */
.news-thumbnail-container.error .news-thumbnail {
    display: none;
}

/* Gradient overlay for better text readability on placeholders */
.news-thumbnail-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    pointer-events: none;
}

/* Additional loading states for better UX */
.news-thumbnail-container.slow-loading .thumbnail-spinner {
    border-top-color: var(--warning-color);
    animation-duration: 1.5s;
}

.news-thumbnail-container.loaded .news-thumbnail {
    opacity: 1;
    animation: fadeInImage 0.3s ease;
}

@keyframes fadeInImage {
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* Skeleton loading animation for thumbnails */
.news-thumbnail-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Improve contrast for better accessibility */
.news-thumbnail-placeholder {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Add subtle animation to placeholders */
.news-thumbnail-placeholder.country-themed .thumbnail-flag-icon,
.news-thumbnail-placeholder.initials-themed .thumbnail-initials-large {
    animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Responsive: Collapse sidebar and show hamburger menu on mobile */
@media (max-width: 767.98px) {
  .app-sidebar {
    transform: translateX(-320px);
    /* Hide sidebar by default on mobile */
  }
  .app-sidebar.collapsed {
    transform: translateX(0);
  }
  .mobile-sidebar-toggle {
    display: flex !important;
    z-index: 1100;
  }
  .app-main {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .main-content {
    padding: var(--space-md) var(--space-sm);
    max-width: 100%;
    width: 100%;
  }
  .main-header {
    padding: var(--space-sm) var(--space-md);
    flex-wrap: wrap;
  }
  .header-left {
    flex: 1;
    min-width: 0;
  }
  .header-right {
    flex-shrink: 0;
  }
  .current-date {
    font-size: var(--font-size-sm);
    padding: var(--space-xs);
  }
  .main-title {
    font-size: var(--font-size-lg);
  }
  body.sidebar-open {
    overflow: hidden;
  }
}

/* Responsive: Enhance news comparison list on mobile */
@media (max-width: 767.98px) {
  .news-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 var(--space-sm);
    max-width: 100%;
    overflow-x: hidden;
  }
  .news-country-section {
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    max-width: 100%;
  }
  .news-country-header {
    padding: 1rem 0.75rem;
    font-size: 1rem;
    gap: 0.5rem;
    word-wrap: break-word;
  }
  .news-article {
    padding: 1rem 0.75rem;
    font-size: 0.97rem;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .news-article-header {
    gap: 0.5rem;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .news-thumbnail-container, .news-thumbnail-placeholder {
    width: 60px;
    height: 45px;
    font-size: 0.7rem;
    flex-shrink: 0;
  }
  .news-article {
    border-radius: 8px;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }
  .news-article:last-child {
    margin-bottom: 0;
  }
  .news-section {
    padding: 1rem 0 6rem 0;
    overflow-x: hidden;
  }
}

/* Responsive: Timeline one element per row on mobile, full width, green line on the side */
@media (max-width: 767.98px) {
  .timeline-container-new {
    padding: 1rem 0 1rem 1.5rem;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }
  .timeline-container-new::before {
    left: 0.5rem;
    transform: none;
    width: 3px;
  }
  .timeline-event-new {
    flex-direction: row;
    justify-content: flex-start !important;
    align-items: flex-start;
    margin-bottom: 2rem;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .timeline-event-new::before {
    left: 0.5rem;
    top: 2rem;
    transform: none;
    z-index: 2;
  }
  .event-card-compact {
    max-width: calc(100vw - 4rem);
    margin: 0 0 0 2.5rem !important;
    width: calc(100% - 2.5rem);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    overflow: hidden;
    word-wrap: break-word;
  }
  .timeline-event-new:nth-child(odd) .event-card-compact,
  .timeline-event-new:nth-child(even) .event-card-compact {
    margin: 0 0 0 2.5rem !important;
    max-width: calc(100vw - 4rem);
  }
  .event-title-compact {
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .event-time-compact {
    font-size: 0.85rem;
    flex-wrap: wrap;
  }
  .event-meta-compact {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* RTL: Timeline mobile fix for horizontal scroll and correct alignment */
@media (max-width: 767.98px) {
  html[dir="rtl"] .timeline-container-new {
    padding: 1rem 1.5rem 1rem 0;
    overflow-x: hidden;
  }
  html[dir="rtl"] .timeline-container-new::before {
    left: auto;
    right: 0.5rem;
    transform: none;
  }
  html[dir="rtl"] .timeline-event-new::before {
    left: auto;
    right: 0.5rem;
    top: 2rem;
    transform: none;
  }
  html[dir="rtl"] .event-card-compact {
    margin: 0 2.5rem 0 0 !important;
    max-width: calc(100vw - 4rem);
  }
  html[dir="rtl"] .timeline-event-new:nth-child(odd) .event-card-compact,
  html[dir="rtl"] .timeline-event-new:nth-child(even) .event-card-compact {
    margin: 0 2.5rem 0 0 !important;
    max-width: calc(100vw - 4rem);
  }
}

/* Prevent horizontal scroll on body */
body {
  overflow-x: hidden;
}

/* Additional mobile fixes to prevent horizontal scroll */
* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

.app-container,
.app-layout,
.app-main,
.main-content {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Additional mobile viewport and overflow fixes */
@media (max-width: 767.98px) {
  /* Ensure all text elements wrap properly */
  .event-title-compact,
  .news-article h5,
  .news-article p,
  .main-title,
  .section-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  /* Prevent images and media from overflowing */
  img,
  .news-thumbnail,
  .news-thumbnail-placeholder {
    max-width: 100%;
    height: auto;
  }
  
  /* Constrain all flex containers */
  .header-left,
  .header-right,
  .event-meta-compact,
  .news-article-header {
    min-width: 0;
    flex-wrap: wrap;
  }
  
  /* Ensure dropdowns don't overflow */
  .dropdown-menu,
  .date-picker-dropdown {
    max-width: calc(100vw - 2rem);
    left: 1rem !important;
    right: 1rem !important;
    transform: none !important;
  }
  
  /* Fix sidebar width on small screens */
  .app-sidebar {
    width: min(320px, 85vw);
  }
  
  /* Constrain modal width */
  .modal-dialog {
    max-width: calc(100vw - 2rem);
    margin: 1rem;
  }
  
  /* Ensure buttons don't overflow */
  .btn {
    word-wrap: break-word;
    white-space: normal;
  }
  
  /* Fix timeline section padding */
  .timeline-section {
    padding: 1rem 0;
    overflow-x: hidden;
  }
  
  /* Additional container constraints */
  .container,
  .container-fluid {
    max-width: 100vw;
    overflow-x: hidden;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
}

/* Ultra small screens (below 400px) */
@media (max-width: 399.98px) {
  .main-content {
    padding: var(--space-sm) var(--space-xs);
  }
  
  .timeline-container-new {
    padding: 1rem 0 1rem 1rem;
  }
  
  .event-card-compact {
    max-width: calc(100vw - 2.5rem);
    margin: 0 0 0 1.5rem !important;
  }
  
  html[dir="rtl"] .event-card-compact {
    margin: 0 1.5rem 0 0 !important;
    max-width: calc(100vw - 2.5rem);
  }
  
  .main-header {
    padding: var(--space-xs) var(--space-sm);
  }
  
  .current-date {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  .main-title {
    font-size: var(--font-size-md);
  }
}
