:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --hover-color: #f1f5f9;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --hover-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* RTL Support */
html {
    direction: rtl;
    text-align: right;
}

body {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
    direction: rtl;
    text-align: right;
}

/* RTL specific adjustments */
.container {
    direction: rtl;
}

/* LTR for content that should remain left-to-right */
.news-description img,
.news-description figure,
.news-description .wp-caption,
code,
pre {
    direction: ltr;
}



.news-description img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
}

.news-description figure {
    max-width: 100%;
    margin: 0.5rem 0;
}

.news-description .wp-caption {
    max-width: 100%;
}

.news-description table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.news-description pre,
.news-description code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.news-description {
    direction: rtl;
    text-align: right;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.6;
    padding: 1rem;
}

.news-description p {
    text-align: right;
    direction: rtl;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 0.5rem 0;
}

.news-description * {
    max-width: 100%;
    box-sizing: border-box;
}

.news-description div,
.news-description span {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.current-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    user-select: none;
    position: relative;
    z-index: 10;
}

.btn:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Ensure delete buttons are always clickable */
.article-actions .btn {
    pointer-events: auto;
    position: relative;
    z-index: 25;
    margin: 0.25rem;
}

.article-actions button {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Modern Theme Switch Styles */
.theme-switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem;
}

.theme-switch-label {
    font-size: 1.2rem;
    opacity: 0.6;
    transition: all 0.3s ease;
    filter: grayscale(100%);
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 32px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 2px;
    top: 2px;
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.theme-slider-icon {
    position: absolute;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    opacity: 0.8;
}

/* Checked state - Dark Mode Active */
input:checked + .theme-slider {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 12px rgba(16, 185, 129, 0.3);
}

input:checked + .theme-slider:before {
    transform: translateX(32px);
    background: linear-gradient(145deg, #ffffff, #f8fafc);
}

input:checked + .theme-slider .theme-slider-icon {
    transform: translateX(32px) translateY(-50%);
    opacity: 1;
}

/* Icon positioning and styling */
.theme-slider .theme-slider-icon {
    color: #6b7280;
}

input:checked + .theme-slider .theme-slider-icon {
    color: #374151;
}

/* Focus styles for accessibility */
.theme-switch input:focus + .theme-slider {
    outline: 2px solid rgba(16, 185, 129, 0.5);
    outline-offset: 2px;
}

/* Hover effects */
.theme-switch:hover .theme-switch-label {
    opacity: 1;
    filter: grayscale(0%);
}

.theme-switch:hover .theme-slider {
    transform: scale(1.02);
}

.theme-switch:hover .theme-slider:before {
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Active state */
.theme-switch:active .theme-slider {
    transform: scale(0.98);
}

/* Label highlighting based on theme */
[data-theme="light"] .theme-switch-container .theme-switch-label:first-child {
    opacity: 1;
    filter: grayscale(0%);
    color: #10b981;
}

[data-theme="dark"] .theme-switch-container .theme-switch-label:last-child {
    opacity: 1;
    filter: grayscale(0%);
    color: #10b981;
}

/* Dark theme adjustments */
[data-theme="dark"] .theme-slider {
    background-color: #4b5563;
}

[data-theme="dark"] input:checked + .theme-slider {
    background: linear-gradient(135deg, #10b981, #059669);
}

.tabs {
    display: flex;
    gap: 0.25rem;
    margin: 2rem 0 1rem 0;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    padding-bottom: 10px;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    position: relative;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
}

.news-grid {
    gap: 5px;
    margin-bottom: 2rem;
}

.news-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
	margin-bottom: 5px;
}

.news-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px) scale(1.05);
}

.news-item:hover .news-title {
    font-size: 15px;
}

.news-item:hover .news-source {
    font-size: 15px;
}

.news-item:hover .news-time {
    font-size: 15px;
}

.news-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    flex: 1;
    line-height: 1.4;
}

.news-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.news-source {
    /*background: var(--primary-color);*/
    color: #ef4444;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.source-logo {
    width: 25px;
    height: 25px;
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: cover;
    min-width: 25px;
    min-height: 25px;
}

/* Accordion Styles */
.accordion-item {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.accordion-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    padding: 2px;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: background-color 0.2s ease;
    position: relative;
    min-height: fit-content;
    align-items: center;
}

.accordion-header:hover {
    background-color: var(--border-color);
}

.accordion-icon {
    font-size: 1rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.news-time {
    font-size: 15px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
	padding-right: 12px;
}

.news-title-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
    padding: 0;
    overflow: hidden;
    min-width: 0;
}

.news-meta-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
    font-size: 0.875rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.news-category {
    background: var(--secondary-color);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.news-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(var(--border-color), 0.3);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 0.5rem 0.5rem;
    margin-top: -0.5rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

.action-btn:hover {
    background: rgba(var(--primary-color), 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.action-text {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}



.ai-summary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-summary-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
}

.ai-summary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ai-summary-btn.loading {
    animation: ai-pulse 1.5s infinite;
}

@keyframes ai-pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

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

.accordion-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease, color 0.2s ease;
    cursor: pointer;
}

.whatsapp-share {
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.whatsapp-share svg {
    width: 25px;
    height: 25px;
    transition: all 0.2s ease;
}

.whatsapp-share:hover {
    opacity: 1;
    transform: scale(1.1);
}

.whatsapp-share:hover svg {
    transform: scale(1.05);
}

.accordion-header:hover .accordion-icon {
    color: var(--primary-color);
}

.accordion-content {
    padding: 0 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.accordion-item.active .accordion-content {
    padding: 0 0.5rem;
    max-height: 1000px;
    overflow: auto;
    opacity: 1;
    margin-top: 1rem;
    transition: max-height 0.3s ease, opacity 0.2s ease 0.1s, margin-top 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.article-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
    position: relative;
    z-index: 20;
}

.read-full-btn {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.read-full-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

/* News item adjustments for accordion */
.news-item .news-meta {
    margin-bottom: 0;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface-color);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

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

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--background-color);
    color: var(--text-primary);
    font-size: 1rem;
	font-family: system-ui;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
   background: linear-gradient(135deg, #000000, #002474);
}

.login-form {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.source-info h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.source-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.source-actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert {
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header {
        padding: 0.5rem 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .logo {
        font-size: 1.25rem;
        text-align: center;
    }
    
    .current-time {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
        margin: 1rem 0;
    }
    
    .tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: auto;
        flex: 0 1 auto;
    }
    
    .tab-badge {
        font-size: 0.7rem;
        padding: 0.1rem 0.3rem;
    }
    
    .news-grid {
        gap: 0.5rem;
        margin-bottom: 1rem;
		margin-left: 15px;
	}
    
    .news-item {
        margin: 0;
        padding: 0;
    }
    
    .news-title-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0;
        width: 100%;
    }
    
    .news-title {
        font-size: 15px;
        line-height: 1.4;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .news-source {
        font-size: 15px;
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
    }
    
    .source-logo {
        width: 22px;
        height: 22px;
    }
    
    .news-time {
        font-size: 15px;
    }
    
    .news-meta-inline {
        gap: 0.75rem;
        font-size: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
        border-bottom: 1px solid rgba(100, 116, 139, 0.2);
        margin-bottom: 0.25rem;
    }
    
    .accordion-header {
        padding: 0.75rem;
        position: relative;
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .accordion-actions {
        position: static;
        display: flex;
        gap: 0.75rem;
        align-items: center;
        justify-content: flex-end;
        padding: 0.5rem;
        border-top: 1px solid var(--border-color);
        background: rgba(var(--border-color), 0.3);
        border-radius: 0.375rem;
        margin-top: 0.5rem;
    }
    
    .accordion-icon {
        position: static;
        margin: 0;
        font-size: 0.75rem;
    }
    
    .copy-article-btn,
    .download-image-btn,
    .ai-summary-btn {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.5rem;
    }
    
    .copy-article-btn svg,
    .download-image-btn svg,
    .ai-summary-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .accordion-content {
        padding: 0.75rem;
    }
    
    .news-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .article-actions {
        margin-top: 1rem;
    }
    
    .read-full-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .empty-state {
        padding: 2rem 0.5rem;
    }
    
    .empty-state h3 {
        font-size: 1.1rem;
    }
}

/* Additional mobile optimizations for smaller screens */
@media (max-width: 480px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .header-actions {
        gap: 0.125rem;
    }
    
    .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .news-title {
        font-size: 0.85rem;
        line-height: 1.25;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .news-source {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
        gap: 0.2rem;
    }
    
    .source-logo {
        width: 12px;
        height: 12px;
    }
    
    .news-time {
        font-size: 0.65rem;
    }
    
    .accordion-header {
        padding: 0.6rem;
        min-height: auto;
        flex-direction: column;
        gap: 0.6rem;
    }
    
    .news-title-line {
        padding: 0;
        gap: 0.4rem;
        width: 100%;
    }
    
    .accordion-actions {
        position: static;
        gap: 0.5rem;
        padding: 0.4rem;
        border-top: 1px solid var(--border-color);
        background: rgba(var(--border-color), 0.2);
        border-radius: 0.3rem;
        margin-top: 0.4rem;
        justify-content: flex-end;
    }
    
    .copy-article-btn,
    .download-image-btn,
    .ai-summary-btn {
        padding: 0.4rem;
        min-width: 40px;
        min-height: 40px;
        border-radius: 0.4rem;
    }
    
    .copy-article-btn svg,
    .download-image-btn svg,
    .ai-summary-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .accordion-icon {
        font-size: 0.7rem;
    }
}

/* Extra small screens optimization */
@media (max-width: 360px) {
    .container {
        padding: 0 0.1rem;
    }
    
    .news-title {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .news-source {
        font-size: 0.55rem;
        padding: 0.1rem 0.25rem;
        gap: 0.15rem;
    }
    
    .source-logo {
        width: 10px;
        height: 10px;
    }
    
    .news-time {
        font-size: 0.6rem;
    }
    
    .accordion-header {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .news-title-line {
        padding: 0;
        gap: 0.3rem;
        width: 100%;
    }
    
    .accordion-actions {
        position: static;
        gap: 0.4rem;
        padding: 0.3rem;
        border-top: 1px solid var(--border-color);
        background: rgba(var(--border-color), 0.15);
        border-radius: 0.25rem;
        margin-top: 0.3rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .copy-article-btn,
    .download-image-btn,
    .ai-summary-btn {
        padding: 0.35rem;
        min-width: 36px;
        min-height: 36px;
        border-radius: 0.3rem;
    }
    
    .copy-article-btn svg,
    .download-image-btn svg,
    .ai-summary-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .accordion-icon {
        font-size: 0.65rem;
    }
}


/* Hebrew RTL Content Styling */
.news-description img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

.news-description figure {
    margin: 1rem 0;
    text-align: center;
}

.news-description figcaption,
.news-description .wp-caption-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
    text-align: right;
}

.news-description h2, 
.news-description h3, 
.news-description h4 {
    margin: 1.5rem 0 1rem 0;
    color: var(--text-primary);
}

.news-description p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.news-description a {
    color: var(--primary-color);
    text-decoration: none;
}

.news-description a:hover {
    text-decoration: underline;
}

.news-description strong {
    font-weight: 600;
}

/* RTL Button alignment */
.article-actions {
    text-align: right;
    margin-top: 1.5rem;
	margin-bottom: 1.5rem;
}

/* RTL Header adjustments */
.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: row-reverse;
}

/* RTL Accordion icon positioning */
.accordion-icon {
    margin-right: 1rem;
    margin-left: 0;
}

/* RTL Meta inline adjustments */
.news-meta-inline {
    flex-direction: row-reverse;
}

/* Copy Button Styles */
.copy-article-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-article-btn:hover {
    background: var(--border-color);
    color: var(--primary-color);
}

.copy-article-btn svg {
    width: 20px;
    height: 20px;
}

/* Tab Styles */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: flex-start;
    text-align: right;
    flex-wrap: wrap;
    align-items: center;
}

.tab {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.tab:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    min-width: 1.5rem;
    text-align: center;
}

.tab.active .tab-badge {
    background: white;
    color: var(--primary-color);
}

.tab-select {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-left: 2.5rem;
}


.tab-content {
    display: none;
}

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

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .news-item {
        margin: 10px;
        padding: 0;
    }
    
    .accordion-header {
        padding: 0.75rem;
        border-radius: 0.5rem 0.5rem 0 0;
    }
    
    .news-meta {
        margin-bottom: 0.25rem;
    }
    
    .news-title {
        font-size: 15px;
        line-height: 1.4;
        margin-bottom: 0.25rem;
        padding-right: 2rem;
    }
    
    .news-source {
        font-size: 15px;
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
    }
    
    .source-logo {
        width: 20px;
        height: 20px;
    }
    
    .news-time {
        font-size: 15px;
    }
    
    .news-actions {
        gap: 0.5rem;
        padding: 0.5rem;
        background: rgba(100, 116, 139, 0.15);
        border-radius: 0 0 0.5rem 0.5rem;
    }
    
    .action-btn {
        min-width: 48px;
        min-height: 48px;
        padding: 0.5rem 0.25rem;
    }
    
    .action-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .action-text {
        font-size: 0.65rem;
    }
    
    .accordion-content {
        padding: 0.75rem;
    }
    
    .news-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .article-actions {
        margin-top: 1rem;
    }
    
    .read-full-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Additional mobile optimizations for smaller screens */
@media (max-width: 480px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .accordion-header {
        padding: 0.6rem;
    }
    
    .news-actions {
        gap: 0.4rem;
        padding: 0.4rem;
        background: rgba(100, 116, 139, 0.12);
    }
    
    .action-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.4rem 0.2rem;
    }
    
    .action-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .action-text {
        font-size: 0.6rem;
    }
    
    .news-title {
        font-size: 0.9rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        margin-bottom: 0.3rem;
    }
    
    .news-source {
        font-size: 0.65rem;
        padding: 0.2rem 0.3rem;
        gap: 0.2rem;
    }
    
    .source-logo {
        width: 16px;
        height: 16px;
    }
    
    .news-time {
        font-size: 0.65rem;
    }
    
    .accordion-icon {
        font-size: 0.7rem;
    }
}

/* Extra small screens optimization */
@media (max-width: 360px) {
    .container {
        padding: 0 0.1rem;
    }
    
    .accordion-header {
        padding: 0.5rem;
    }
    
    .news-actions {
        gap: 0.3rem;
        padding: 0.3rem;
        background: rgba(100, 116, 139, 0.08);
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .action-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.3rem 0.15rem;
    }
    
    .action-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .action-text {
        font-size: 0.55rem;
    }
    
    .news-title {
        font-size: 0.85rem;
        line-height: 1.25;
        margin-bottom: 0.3rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        padding-right: 1.5rem;
    }
    
    .accordion-icon {
        font-size: 0.65rem;
    }
}


        /* New NewsFlash Button and Dropdown System */
        .nf-countdown-wrapper,
        .nf-filter-wrapper {
            position: relative;
            display: inline-block;
        }

        .nf-countdown-trigger,
        .nf-filter-trigger {
            background: var(--surface-color) !important;
            border: 1px solid var(--border-color) !important;
            color: var(--text-primary) !important;
            padding: 0.5rem 0.75rem !important;
            border-radius: 0.375rem !important;
            cursor: pointer !important;
            transition: all 0.2s ease !important;
            display: flex !important;
            align-items: center !important;
            gap: 0.5rem !important;
            user-select: none !important;
            pointer-events: auto !important;
            z-index: 100 !important;
            position: relative !important;
        }

        .nf-countdown-trigger:hover,
        .nf-filter-trigger:hover {
            background: var(--hover-color) !important;
            border-color: var(--primary-color) !important;
            transform: translateY(-1px) !important;
        }

        .nf-countdown-trigger.nf-trigger-active,
        .nf-filter-trigger.nf-trigger-active {
            background: var(--primary-color) !important;
            color: white !important;
            border-color: var(--primary-color) !important;
        }

        .nf-dropdown-menu {
            display: none;
            position: absolute;
            background-color: var(--surface-color);
            min-width: 120px;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            border-radius: 0.5rem;
            border: 1px solid var(--border-color);
            top: 100%;
            right: 0;
            margin-top: 0.25rem;
            padding: 0.25rem;
        }

        .nf-dropdown-menu.nf-dropdown-active {
            display: block !important;
        }

        .nf-dropdown-menu button,
        .nf-dropdown-menu a {
            width: 100%;
            background: none;
            border: none;
            color: var(--text-primary);
            padding: 0.5rem 0.75rem;
            text-decoration: none;
            display: block;
            transition: background-color 0.2s ease;
            border-radius: 0.375rem;
            cursor: pointer;
            font-size: 0.875rem;
            text-align: right;
            margin: 1px 0;
        }

        .nf-dropdown-menu button:hover,
        .nf-dropdown-menu a:hover {
            background-color: var(--hover-color);
            color: var(--text-primary);
        }

        .nf-dropdown-menu button.nf-active,
        .nf-dropdown-menu a.nf-active {
            background-color: var(--primary-color);
            color: white;
        }

        .nf-dropdown-menu button.nf-active:hover,
        .nf-dropdown-menu a.nf-active:hover {
            background-color: var(--primary-hover);
            color: white;
        }

        /* Auto refresh button styling */
        .nf-auto-refresh-btn {
            background: var(--success-color) !important;
            color: white !important;
            border: none !important;
            padding: 0.5rem 0.75rem !important;
            border-radius: 0.375rem !important;
            cursor: pointer !important;
            transition: all 0.2s ease !important;
            display: flex !important;
            align-items: center !important;
            gap: 0.25rem !important;
            font-size: 0.875rem !important;
            user-select: none !important;
            pointer-events: auto !important;
            z-index: 100 !important;
            position: relative !important;
        }

        .nf-auto-refresh-btn:hover {
            background: #059669 !important;
            transform: translateY(-1px) !important;
            box-shadow: var(--shadow) !important;
        }

        .nf-auto-refresh-btn:not(.nf-active) {
            background: #6b7280 !important;
        }

        .nf-auto-refresh-btn:not(.nf-active):hover {
            background: #4b5563 !important;
        }

        /* Notification system */
        .nf-notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 12px 20px;
            border-radius: 6px;
            color: white;
            z-index: 10000;
            font-size: 14px;
            box-shadow: var(--shadow-lg);
            max-width: 300px;
            word-wrap: break-word;
            animation: nf-slide-in 0.3s ease-out;
        }

        @keyframes nf-slide-in {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        .nf-notification-success {
            background: var(--success-color);
        }

        .nf-notification-error {
            background: var(--danger-color);
        }

        .nf-notification-info {
            background: var(--primary-color);
        }

        /* Refresh functionality styles */
        .spinner {
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 2px solid var(--border-color);
            border-radius: 50%;
            border-top-color: var(--primary-color);
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .refresh-notification {
            position: fixed;
            top: 20px;
            right: 20px;
            background: var(--surface-color);
            border: 1px solid var(--border-color);
            border-radius: 0.5rem;
            padding: 1rem;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            min-width: 300px;
            max-width: 400px;
            transition: all 0.3s ease;
        }

        .refresh-notification.success {
            border-left: 4px solid var(--success-color);
        }

        .refresh-notification.error {
            border-left: 4px solid var(--danger-color);
        }

        .refresh-notification h4 {
            margin: 0 0 0.5rem 0;
            color: var(--text-primary);
            font-size: 1rem;
        }

        .refresh-notification p {
            margin: 0;
            color: var(--text-secondary);
            font-size: 0.875rem;
        }

        .refresh-progress-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0.25rem 0;
            font-size: 0.875rem;
        }

        .refresh-progress-item .status {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
        }

        .refresh-progress-item .status.loading {
            background: var(--warning-color);
            color: white;
        }

        .refresh-progress-item .status.success {
            background: var(--success-color);
            color: white;
        }

        .refresh-progress-item .status.error {
            background: var(--danger-color);
            color: white;
        }

        .auto-refresh-indicator {
            position: fixed;
            bottom: 20px;
            left: 20px;
            background: var(--surface-color);
            border: 1px solid var(--border-color);
            border-radius: 0.5rem;
            padding: 0.5rem 1rem;
            font-size: 0.875rem;
            color: var(--text-secondary);
            box-shadow: var(--shadow);
            z-index: 1000;
            display: none;
        }

        .auto-refresh-indicator.active {
            display: block;
        }

        /* Auto-refresh specific styling */
        .refresh-notification.auto-refresh {
            bottom: 20px;
            top: auto;
            right: 20px;
            min-width: 200px;
            max-width: 250px;
            opacity: 0.9;
        }

        .refresh-notification.auto-refresh h4 {
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
        }

        /* Refresh Controls Interface */
        .refresh-controls {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .countdown-settings-dropdown {
            position: relative;
            display: inline-block;
        }

        .countdown-settings-btn {
            background: #6b7280 !important;
            color: white !important;
            border: none !important;
            padding: 0.5rem 0.75rem !important;
            border-radius: 0.375rem !important;
            font-size: 0.875rem !important;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            min-width: 60px;
        }

        .countdown-settings-btn:hover {
            background: #4b5563 !important;
        }

        /* Ensure countdown dropdown button is always clickable */
        .countdown-settings-btn {
            position: relative !important;
            z-index: 100 !important;
            pointer-events: auto !important;
        }

        .countdown-dropdown-content {
            display: none;
            position: absolute;
            right: 0;
            background-color: var(--surface-color);
            min-width: 80px;
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border-color);
            border-radius: 0.375rem;
            z-index: 1000;
            margin-top: 0.25rem;
        }

        .countdown-dropdown-content.show {
            display: block !important;
        }


        .countdown-dropdown-content button {
            color: var(--text-primary);
            padding: 0.5rem 0.75rem;
            text-decoration: none;
            display: block;
            border: none;
            background: none;
            width: 100%;
            text-align: right;
            cursor: pointer;
            font-size: 0.875rem;
            transition: background-color 0.2s ease;
        }

        .countdown-dropdown-content button:hover {
            background-color: var(--hover-color);
        }

        .countdown-dropdown-content button:first-child {
            border-radius: 0.375rem 0.375rem 0 0;
        }

        .countdown-dropdown-content button:last-child {
            border-radius: 0 0 0.375rem 0.375rem;
        }

        .countdown-dropdown-content button.active {
            background-color: var(--primary-color);
            color: white;
        }

        .auto-refresh-indicator {
            position: static !important;
            display: flex !important;
            align-items: center;
            background: var(--success-color) !important;
            color: white !important;
            border-radius: 0.375rem !important;
            padding: 0.5rem 0.75rem !important;
            font-size: 11px !important;
            border: none !important;
            box-shadow: var(--shadow) !important;
            cursor: pointer !important;
            transition: all 0.2s ease !important;
        }

        .auto-refresh-indicator:hover {
            background: #059669 !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
        }

        .auto-refresh-indicator:active {
            transform: translateY(0) !important;
            box-shadow: var(--shadow) !important;
        }

        .auto-refresh-indicator[data-status="off"] {
            background: #6b7280 !important;
        }

        .auto-refresh-indicator[data-status="off"]:hover {
            background: #4b5563 !important;
        }

        .auto-refresh-status {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        /* Mobile responsiveness for refresh controls */
        @media (max-width: 768px) {
            .refresh-controls {
                width: 100%;
                justify-content: center;
                margin: 0.5rem 0;
            }
            
            .countdown-settings-btn {
                font-size: 0.75rem !important;
                padding: 0.4rem 0.6rem !important;
            }
            
            .auto-refresh-indicator {
                font-size: 0.75rem !important;
                padding: 0.4rem 0.6rem !important;
            }
        }
