:root {
    --primary-color: #2b6cb0;
    --secondary-color: #2c5282;
    --accent-color: #c53030;
    --text-color: #2d3748;
    --text-color-light: #4a5568;
    --background-color: #f7fafc;
    --panel-background: #edf2f7;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #2f855a;
    --warning-color: #c05621;
    --header-height: 60px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Base Styles */
body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    margin: 0;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    color: var(--primary-color);
    padding: 0 1rem;
    height: var(--header-height);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-container h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.logo-section h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    display: block;
    margin-top: 0.25rem;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.nav-tab {
    background: none;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-tab.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
}

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

.settings-btn {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid var(--border-color);
    color: var(--text-color-light);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.settings-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.settings-btn svg {
    width: 22px;
    height: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.settings-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(43, 108, 176, 0.25);
}

.settings-btn:hover::before {
    opacity: 1;
}

.settings-btn:hover svg {
    color: white;
    transform: rotate(90deg) scale(1.1);
}

/* API Management Section */
.api-management-section {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.add-api-section {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.add-api-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.add-api-section form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.add-api-section input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.add-api-section input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

.add-api-section button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-api-section button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.add-api-section button:hover {
    background: linear-gradient(135deg, #1a4d8c, #2c5282);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43, 108, 176, 0.4);
}

.add-api-section button:hover::before {
    left: 100%;
}

.api-management-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.api-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.api-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.api-item.user-api {
    background: #e6fffa;
    border-color: var(--success-color);
}

.api-label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.85rem;
}

.api-preview {
    font-family: monospace;
    font-size: 0.8rem;
    color: #666;
}

.delete-api-btn {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: var(--accent-color);
    border: 1px solid #fca5a5;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.delete-api-btn svg {
    transition: transform 0.3s ease;
}

.delete-api-btn:hover svg {
    transform: scale(1.1);
}

.delete-api-btn:hover {
    background: linear-gradient(135deg, var(--accent-color), #e53e3e);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.3);
}

.delete-api-btn.permanent {
    color: var(--accent-color);
}

.delete-api-btn.permanent:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Eita Test Section */
.eita-test-section {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.eita-test-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.eita-test-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.test-eita-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.test-eita-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.test-eita-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.eita-test-result {
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    margin-top: 0.5rem;
}

.eita-test-result.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #10b981;
}

.eita-test-result.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    border: 1px solid #ef4444;
}

.test-template-group {
    margin-bottom: 20px;
}

.test-template-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

#eita-template {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

.template-variables {
    margin-top: 10px;
}

.template-variables label {
    font-size: 12px;
    color: var(--text-color-light);
    margin-bottom: 6px;
}

.variable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.var-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border: 1px solid #bbdefb;
    transition: all 0.2s;
}

.var-tag:hover {
    background: #bbdefb;
    transform: translateY(-1px);
}

.test-success, .test-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Logs Section */
.logs-section {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.logs-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.logs-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.clear-logs-btn,
.export-logs-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-logs-btn {
    background: linear-gradient(135deg, var(--accent-color), #e53e3e);
    color: white;
}

.clear-logs-btn svg {
    transition: transform 0.3s ease;
}

.clear-logs-btn:hover svg {
    transform: scale(1.1);
}

.clear-logs-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.clear-logs-btn:hover {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(197, 48, 48, 0.4);
}

.clear-logs-btn:hover::before {
    left: 100%;
}

.export-logs-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
}

.export-logs-btn svg {
    transition: transform 0.3s ease;
}

.export-logs-btn:hover svg {
    transform: scale(1.1);
}

.export-logs-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.export-logs-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), #1a4d8c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43, 108, 176, 0.4);
}

.export-logs-btn:hover::before {
    left: 100%;
}

.logs-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--light-gray);
}

.logs-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.log-item {
    padding: 0.5rem;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    background: white;
    margin-bottom: 2px;
}

.log-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.log-item.error {
    background: #fed7d7;
    border-right: 3px solid var(--accent-color);
}

.log-item.success {
    background: #c6f6d5;
    border-right: 3px solid var(--success-color);
}

.log-item.info {
    background: #bee3f8;
    border-right: 3px solid var(--secondary-color);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 5px;
}

.log-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-copy-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
}

.log-copy-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #333;
    transform: scale(1.05);
}

.log-copy-btn:active {
    transform: scale(0.95);
}

.log-type {
    font-weight: 600;
    font-size: 0.85rem;
}

.log-timestamp {
    font-size: 0.75rem;
    color: #666;
    font-family: 'Courier New', monospace;
}

.log-message {
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.log-details {
    display: none;
    background: rgba(0,0,0,0.05);
    padding: 0.5rem;
    margin-top: 0.5rem;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.8rem;
    transition: max-height 0.3s ease;
}

.log-details.expanded {
    display: block;
    max-height: 300px;
    overflow-y: auto;
}

.log-toggle {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.log-toggle:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(43, 108, 176, 0.3);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.active { 
    display: flex; 
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid #e0e0e0;
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-header h3 { 
    margin: 0; 
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background: white;
}

.close-btn { 
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.close-btn:hover {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    border-color: #fca5a5;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

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

/* Form Styles in Modal */
.modal-body .form-row {
    margin-bottom: 1.5rem;
}

.modal-body .form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.modal-body .form-row input,
.modal-body .form-row textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.modal-body .form-row input:focus,
.modal-body .form-row textarea:focus {
    outline: none;
    border-color: #4CAF50;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.modal-body .form-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    font-style: italic;
}

.modal-body .primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.modal-body .primary:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.modal-body .actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.originals-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.originals-container .card {
    margin-bottom: 0;
    pointer-events: none;
}

.originals-container .card-checkbox, .originals-container .regenerate-btn { display: none; }

/* Settings Modal (minor adjustments from previous CSS) */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    display: flex; /* Always use flex for centering */
    opacity: 0; /* Start hidden */
    visibility: hidden; /* Start inaccessible */
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.settings-modal[style*="display: block;"] {
    display: flex !important; /* حفظ فلکس برای مرکزچینی حتی با استایل اینلاین */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.settings-content {
    background: white;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.settings-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color-light);
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

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

.settings-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.settings-body label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.settings-body select, .settings-body input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    margin-bottom: 1rem;
}

.save-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.3);
    position: relative;
    overflow: hidden;
}

.save-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.save-btn:hover {
    background: linear-gradient(135deg, #1a4d8c, #2c5282);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43, 108, 176, 0.4);
}

.save-btn:hover::before {
    left: 100%;
}

/* API Documentation Styles */
.api-docs-section {
    display: none;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    padding-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    box-sizing: border-box;
}

.incoming-panel {
    width: 380px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: width 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.processed-panel {
    flex-grow: 1;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background-color: #fff;
    gap: 1rem;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.panel-header-actions {
    display: flex;
    gap: 0.5rem;
    margin-right: auto;
}

.panel-header-actions button {
     width: auto;
}

#countdown-timer {
    display: none; /* Removed as per user request */
}

#refresh-incoming-btn {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-color-light);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

#refresh-incoming-btn svg {
    transition: transform 0.3s ease;
}

#refresh-incoming-btn:hover svg {
    transform: rotate(180deg);
}

#refresh-incoming-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#refresh-incoming-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43, 108, 176, 0.3);
}

#refresh-incoming-btn:hover::before {
    left: 100%;
}

#fetch-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

#fetch-settings-btn .ri-filter-3-line {
    font-size: 18px;
}

#fetch-settings-modal .modal-content {
    width: 520px;
    max-width: 92vw;
    background: #fff;
}

#fetch-settings-modal .form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-hint {
    display: block;
    color: var(--text-color-light);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}

#fetch-settings-modal .form-row textarea,
#fetch-settings-modal .form-row input[type="number"] {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    padding: 10px 12px;
}

#fetch-settings-modal .keyword-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

#fetch-settings-modal .keyword-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

#fetch-settings-modal .keyword-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.1);
}

/* فاصله‌گذاری بر اساس دسته‌بندی */
#fetch-settings-modal .keyword-card[data-batch] {
    margin-bottom: 4px;
}

#fetch-settings-modal .keyword-card[data-batch]:not(:last-child) {
    margin-bottom: 4px;
}

/* فاصله بیشتر بین دسته‌های مختلف */
#fetch-settings-modal .keyword-card[data-batch] + #fetch-settings-modal .keyword-card[data-batch] {
    margin-top: 12px;
}

/* انیمیشن تغییر فاصله */
#fetch-settings-modal .keyword-card {
    transition: margin 0.3s ease, border-radius 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

/* انیمیشن ورود کارت‌های جدید */
#fetch-settings-modal .keyword-card.new-batch {
    animation: slideInFromTop 0.4s ease-out;
}

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

/* فاصله کمتر بین کارت‌های هم‌دسته */
#fetch-settings-modal .keyword-card[data-batch] + #fetch-settings-modal .keyword-card[data-batch] {
    margin-top: 4px;
}

/* فاصله بیشتر بین دسته‌های مختلف */
#fetch-settings-modal .keyword-card.new-batch {
    margin-top: 16px;
}

/* اولین کارت هر دسته */
#fetch-settings-modal .keyword-card.new-batch:first-child {
    margin-top: 0;
}

/* خط عمودی رنگی برای نمایش دسته‌بندی */
#fetch-settings-modal .keyword-card::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 2px 0 0 2px;
}

/* رنگ‌های مختلف برای دسته‌های مختلف */
#fetch-settings-modal .keyword-card[data-batch="1"] {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(29, 78, 216, 0.05));
    border-color: rgba(59, 130, 246, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch="1"]::before {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

#fetch-settings-modal .keyword-card[data-batch="2"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(4, 120, 87, 0.05));
    border-color: rgba(16, 185, 129, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch="2"]::before {
    background: linear-gradient(135deg, #10b981, #047857);
}

#fetch-settings-modal .keyword-card[data-batch="3"] {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(217, 119, 6, 0.05));
    border-color: rgba(245, 158, 11, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch="3"]::before {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

#fetch-settings-modal .keyword-card[data-batch="4"] {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.05));
    border-color: rgba(239, 68, 68, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch="4"]::before {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

#fetch-settings-modal .keyword-card[data-batch="5"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(124, 58, 237, 0.05));
    border-color: rgba(139, 92, 246, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch="5"]::before {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

#fetch-settings-modal .keyword-card[data-batch="6"] {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(8, 145, 178, 0.05));
    border-color: rgba(6, 182, 212, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch="6"]::before {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

#fetch-settings-modal .keyword-card[data-batch="7"] {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(234, 88, 12, 0.05));
    border-color: rgba(249, 115, 22, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch="7"]::before {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

#fetch-settings-modal .keyword-card[data-batch="8"] {
    background: linear-gradient(135deg, rgba(132, 204, 22, 0.05), rgba(101, 163, 13, 0.05));
    border-color: rgba(132, 204, 22, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch="8"]::before {
    background: linear-gradient(135deg, #84cc16, #65a30d);
}

/* برای دسته‌های بیشتر از 8 */
#fetch-settings-modal .keyword-card[data-batch]:not([data-batch="1"]):not([data-batch="2"]):not([data-batch="3"]):not([data-batch="4"]):not([data-batch="5"]):not([data-batch="6"]):not([data-batch="7"]):not([data-batch="8"]) {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.05), rgba(75, 85, 99, 0.05));
    border-color: rgba(107, 114, 128, 0.2);
}

#fetch-settings-modal .keyword-card[data-batch]:not([data-batch="1"]):not([data-batch="2"]):not([data-batch="3"]):not([data-batch="4"]):not([data-batch="5"]):not([data-batch="6"]):not([data-batch="7"]):not([data-batch="8"])::before {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.keyword-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.keyword-edit-input {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    outline: none;
    min-width: 80px;
    max-width: 150px;
}

.keyword-edit-input:focus {
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
}

.keyword-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    min-width: 200px;
}

.keyword-details {
    display: flex;
    gap: 12px;
    align-items: center;
}

.batch-info {
    font-size: 11px;
    color: var(--text-color-light);
    font-weight: 500;
}

.stats-info {
    font-size: 11px;
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}



#fetch-settings-modal .keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 14px;
    max-width: fit-content;
}

.keyword-info .keyword-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

#fetch-settings-modal .kw-countdown {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: var(--text-color-light);
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    margin-right: 8px;
}

.keyword-info .keyword-actions button {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-color-light);
}

.keyword-info .keyword-actions button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.keyword-info .keyword-actions button[data-action="delete"]:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

#fetch-settings-modal .keyword-add-row {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

#fetch-settings-modal #new-keyword-input {
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    padding: 10px 12px;
}

#fetch-settings-modal .actions {
    display: flex;
    justify-content: flex-start;
}

#fetch-settings-modal .primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

#refresh-incoming-btn .btn-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.5s ease;
}

.tab-content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.panel-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background-color: #fff;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.panel-footer button, .panel-header button {
    width: auto;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif; /* Ensure font consistency */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.3);
    position: relative;
    overflow: hidden;
}

.panel-footer button::before, .panel-header button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.panel-footer button:hover, .panel-header button:hover {
    background: linear-gradient(135deg, #1a4d8c, #2c5282);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(43, 108, 176, 0.4);
}

.panel-footer button:hover::before, .panel-header button:hover::before {
    left: 100%;
}

.panel-header button {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
}

.eita-queue-status {
    background-color: var(--panel-background);
    color: var(--text-color-light);
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 500;
    min-width: 12px;
    text-align: center;
    font-weight: 600;
}

.btn-counter {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
    min-width: 12px;
    text-align: center;
    font-weight: 600;
}

.panel-footer button:disabled, .panel-header button:disabled {
    background: linear-gradient(135deg, #a0aec0, #718096);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.panel-footer button:disabled::before, .panel-header button:disabled::before {
    display: none;
}

/* Make checkboxes hidden by default, show on hover or when checked */
.card-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    z-index: 5;
    accent-color: var(--primary-color);
    opacity: 0;
    transition: all 0.3s ease;
}

.card-checkbox:hover {
    transform: scale(1.1);
}

.card:hover .card-checkbox,
.card-checkbox:checked {
    opacity: 1;
}

/* Beautify search box */
.panel-footer form {
    position: relative;
    display: flex;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.panel-footer form:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(43, 108, 176, 0.15);
}

.panel-footer form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

#manual-search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
}

#manual-search-input::placeholder {
    color: var(--text-color-light);
    opacity: 0.7;
}

#manual-search-form button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.3);
    border-radius: 0 25px 25px 0;
    position: relative;
    overflow: hidden;
}

#manual-search-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#manual-search-form button:hover {
    background: linear-gradient(135deg, #1a4d8c, #2c5282);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(43, 108, 176, 0.4);
}

#manual-search-form button:hover::before {
    left: 100%;
}

#manual-search-form button svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

#manual-search-form button:hover svg {
    transform: scale(1.1);
}

/* Rotating arrow animation for regenerate button */
.rotating-arrow {
    animation: rotate 2s linear infinite;
    transform-origin: 12px 12px;
}

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

.regenerate-btn:hover .rotating-arrow {
    animation-play-state: running;
}

/* Small spinner for loading states */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    padding: 1rem;
}

.load-more-btn {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: center;
}

.load-more-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.load-more-btn .spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Incoming List */
.incoming-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.incoming-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1rem;
    gap: 0.75rem;
    position: relative;
}

.incoming-item:hover {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.1);
    transform: translateY(-2px);
}

.incoming-item:has(.incoming-checkbox:checked) {
    background: linear-gradient(135deg, #ebf8ff, #dbeafe);
    border-color: #90cdf4;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.incoming-checkbox {
    margin: 0 1rem;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    transition: all 0.3s ease;
}

.incoming-checkbox:hover {
    transform: scale(1.1);
}

.incoming-item-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.incoming-item:hover .incoming-item-actions {
    opacity: 1;
}

.incoming-delete-btn {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fca5a5;
    color: var(--accent-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.incoming-delete-btn svg {
    transition: transform 0.3s ease;
}

.incoming-delete-btn:hover svg {
    transform: scale(1.1);
}

.incoming-item:hover .incoming-delete-btn {
    opacity: 1;
    transform: scale(1.1);
}

.incoming-item:hover .incoming-delete-btn svg {
    transform: scale(1.1);
}

.incoming-delete-btn:hover {
    background: linear-gradient(135deg, var(--accent-color), #e53e3e);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.2);
    box-shadow: 0 6px 16px rgba(197, 48, 48, 0.4);
}

.incoming-delete-btn:hover svg {
    transform: scale(1.2) rotate(90deg);
}

.incoming-delete-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.incoming-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    padding-right: 0;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.incoming-label:hover {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    transform: translateX(-2px);
}

.incoming-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.incoming-item:hover .incoming-img {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.2);
}

.incoming-details {
    overflow: hidden;
    flex: 1;
}

.incoming-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.incoming-item:hover .incoming-title {
    color: var(--primary-color);
}

.incoming-description {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin: 6px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.incoming-item:hover .incoming-description {
    color: var(--text-color);
}

.incoming-source {
    font-size: 0.8rem;
    color: var(--text-color-light);
    font-weight: 500;
    margin-top: 4px;
    transition: color 0.3s ease;
}

.incoming-item:hover .incoming-source {
    color: var(--primary-color);
}

.incoming-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 6px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.incoming-item:hover .incoming-status {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(1.05);
}

/* Status styles */
.incoming-status.status-processing {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.incoming-status.status-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    border: 1px solid #ef4444;
}

.incoming-status.status-processed {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #10b981;
}

.incoming-status.status-skipped {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #6b7280;
    border: 1px solid #9ca3af;
}

.incoming-status.status-queued {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #3730a3;
    border: 1px solid #6366f1;
}


/* Processed Grid (Masonry) */
.processed-grid {
    column-count: 3; /* کاهش از 4 به 3 برای عریض‌تر شدن */
    column-gap: 1.5rem;
}

.card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.card:has(.card-checkbox:checked) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.card-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    z-index: 5;
    accent-color: var(--primary-color);
    opacity: 0;
    transition: all 0.3s ease;
}

.card-checkbox:hover {
    transform: scale(1.1);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.card:hover .card-img {
    transform: scale(1.05);
}

.card-content {
    padding: 1rem;
    text-align: right;
}

.editable-content-block {
    margin-bottom: 1rem;
}
.editable-content-block:last-child {
    margin-bottom: 0;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.card-description {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    color: var(--text-color-light);
}

.card-text-content {
    flex-grow: 1;
    transition: background-color 0.2s;
    border-radius: 4px;
    display: block; /* Ensure it takes full width */
}

.card-text-content[contenteditable="true"] {
    background-color: #ebf8ff;
    outline: 1px solid #90cdf4;
    padding: 4px;
    margin: -4px;
}

.card-button-group {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.card-action-btn {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    border: 1px solid var(--border-color);
    color: var(--text-color-light);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.card-action-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(43, 108, 176, 0.3);
}
.card-action-btn svg {
    width: 14px;
    height: 14px;
}

.card-footer {
    padding: 0 1rem 1rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-status {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.card-status.queued {
    background-color: #fffaf0;
    color: #c05621;
    border: 1px solid #fbd38d;
}

.card-status.sent {
    background-color: #f0fff4;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.card-status.failed {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end; /* Align buttons to the right */
}

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

.source-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px; /* Rounded corners */
    color: white;
    text-shadow: none; /* Remove text shadow */
}

.eita-send-btn {
    background: linear-gradient(135deg, #ff7b00, #ff9500);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 123, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.eita-send-btn.retry-send-btn {
    background: linear-gradient(135deg, #c53030, #e53e3e);
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

.eita-send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.eita-send-btn:hover {
    background: linear-gradient(135deg, #e66a00, #e68400);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 123, 0, 0.4);
}

.eita-send-btn:hover::before {
    left: 100%;
}

.eita-send-btn.retry-send-btn:hover {
    background: linear-gradient(135deg, #b22a2a, #d43434);
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.4);
}

.eita-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.eita-sent-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: default;
    white-space: nowrap;
    opacity: 0.8;
}

.view-originals-btn {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-color-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.view-originals-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(43, 108, 176, 0.3);
}

.analysis-card {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-color: #bee3f8;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.analysis-card .card-title {
    color: var(--secondary-color);
}

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

#generate-analysis-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#generate-analysis-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#generate-analysis-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

#generate-analysis-btn:hover::before {
    left: 100%;
}

#generate-analysis-btn .spinner {
    margin-right: 8px; /* Add some space between spinner and text */
}

#merge-selected-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#merge-selected-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#merge-selected-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706, #b7791f);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

#merge-selected-btn:hover:not(:disabled)::before {
    left: 100%;
}

/* Responsive Design for API Docs */
@media (max-width: 768px) {
    .api-container {
        padding: 1rem;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.8rem;
    }
    
    .url {
        width: 100%;
        font-size: 0.75rem;
        word-break: break-all;
    }
    
    .method {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
        min-width: 50px;
    }
    
    .endpoint-details {
        padding: 1rem;
    }
    
    .params-table,
    .limits-table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .code-block {
        font-size: 0.65rem;
        padding: 0.5rem;
        overflow-x: auto;
    }
    
}

/* Responsive Design */
@media (max-width: 1200px) {
    .processed-grid {
        column-count: 3;
    }
}

@media (max-width: 1024px) {
    .processed-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
        height: auto;
    }
    
    .incoming-panel {
        width: 100%;
        height: 50vh;
        min-height: 350px;
        border-left: none;
        border-bottom: 2px solid var(--border-color);
    }
    
    .processed-panel {
        padding: 1rem;
    }
    
    .processed-grid {
        column-count: 1;
    }
}

/* News Selection Controls */
.news-selection-controls {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.selection-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.queue-interval-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.queue-interval-control:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.queue-interval-control svg {
    color: var(--text-color-light);
    flex-shrink: 0;
}

.queue-interval-input {
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    min-width: 3rem;
    max-width: 4rem;
    text-align: center;
}

.queue-interval-input:focus {
    outline: none;
    background: var(--card-bg);
    border-radius: 4px;
}

.queue-interval-input::-webkit-outer-spin-button,
.queue-interval-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.queue-interval-input[type=number] {
    -moz-appearance: textfield;
}

.select-all-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
    border-radius: 4px;
}

.select-all-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}



.select-btn {
    background: linear-gradient(135deg, var(--accent-color), #e53e3e);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.select-btn:first-child {
    background: linear-gradient(135deg, var(--success-color), #059669);
    box-shadow: 0 4px 12px rgba(47, 133, 90, 0.3);
}

.select-btn:first-child:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 8px 20px rgba(47, 133, 90, 0.4);
}

.select-btn svg {
    transition: transform 0.3s ease;
}

.select-btn:hover svg {
    transform: scale(1.1);
}

.select-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.select-btn:hover {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(197, 48, 48, 0.4);
}

.select-btn:hover::before {
    left: 100%;
}

.processing-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.process-btn, .auto-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.process-btn svg {
    transition: transform 0.3s ease;
}

.process-btn:hover svg {
    transform: scale(1.1);
}

.process-btn {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.process-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.process-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(47, 133, 90, 0.4);
}

.process-btn:hover:not(:disabled)::before {
    left: 100%;
}

.process-btn:disabled {
    background: linear-gradient(135deg, #a0aec0, #718096);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.delete-selected-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-color-light);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    position: relative;
    overflow: hidden;
    opacity: 0.6;
}

.delete-selected-btn:hover:not(:disabled) {
    background: transparent;
    color: var(--accent-color);
    border-color: transparent;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.delete-selected-btn:disabled {
    background: transparent;
    cursor: not-allowed;
    opacity: 0.3;
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.delete-selected-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.delete-selected-btn:hover:not(:disabled) svg {
    transform: scale(1.05);
}

.auto-btn {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

.auto-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auto-btn:hover {
    background: linear-gradient(135deg, #d97706, #b7791f);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(192, 86, 33, 0.4);
}

.auto-btn:hover::before {
    left: 100%;
}

/* Add Editorial Button */
.add-editorial-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 3px solid #10b981;
}

.add-editorial-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #059669;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.add-editorial-btn svg {
    transition: transform 0.3s ease;
}

.add-editorial-btn:hover svg {
    transform: scale(1.1) rotate(90deg);
}

/* Auto Processing Toggle Button */
.auto-processing-toggle {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auto-processing-toggle[data-state="stopped"] {
    background: transparent;
    border: 3px solid #10b981;
    color: #10b981;
}

.auto-processing-toggle[data-state="running"] {
    background: #ef4444;
    border: 3px solid #ef4444;
    color: white;
}

.auto-processing-toggle:hover {
    transform: scale(1.1);
}

.auto-processing-toggle[data-state="stopped"]:hover {
    background: #10b981;
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.auto-processing-toggle[data-state="running"]:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.play-icon, .stop-icon {
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auto-processing-toggle[data-state="stopped"] .play-icon {
    opacity: 1;
    transform: scale(1);
}

.auto-processing-toggle[data-state="stopped"] .stop-icon {
    opacity: 0;
    transform: scale(0.8);
}

.auto-processing-toggle[data-state="running"] .play-icon {
    opacity: 0;
    transform: scale(0.8);
}

.auto-processing-toggle[data-state="running"] .stop-icon {
    opacity: 1;
    transform: scale(1);
}

/* News Item Selection */
.news-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: block;
}

.news-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.1);
    transform: translateY(-2px);
}

.news-item.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ebf8ff, #dbeafe);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.news-item.processed {
    opacity: 0.6;
    background: var(--text-muted);
    cursor: not-allowed;
}

.news-item-top {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.5rem;
}
.news-item-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.news-item-meta-grid {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.news-item-image {
    width: 100px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.news-item-bottom {
    padding-right: 2.5rem;
}

.news-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.news-item-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

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

.news-item-source {
    font-weight: 500;
}

.news-item-time {
    direction: ltr;
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 1rem;
    }
    h1 {
        font-size: 1.2rem;
    }
    
    .selection-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .processing-actions {
        flex-direction: column;
    }
    
    .process-btn, .auto-btn {
        justify-content: center;
    }
}

/* Incoming card: aligned content and new meta grid */
.news-item-meta-grid {
    display: grid;
    grid-template-columns: auto 1fr 100px; /* date | spacer | image */
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}
.news-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.news-item-bottom {
    padding-right: 0.25rem;
    padding-left: 0.25rem;
}
.news-item-title {
    text-align: left;
}
.news-item-description {
    text-align: left;
}
.news-item-footer {
    display: flex;
    justify-content: flex-start; /* keep items together on the right side */
    align-items: center;
    gap: 0.5rem;
}

/* keep the source chip compact; do not override colors if themed elsewhere */
.source-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: #eef2ff; /* light capsule for incoming cards */
    color: #3730a3;
}

/* push delete button to the far left in RTL layout */
.incoming-delete-btn { margin-right: auto; }

/* Incoming card: align date beside image at bottom and make it lighter */
.news-item-meta-grid { align-items: end; }
.news-item-image { align-self: end; }
.news-item-date {
    align-self: end;
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.75;
}

/* Tighten spacing between date and image */
.news-item-meta-grid { column-gap: 0.5rem; }
.news-item-date { margin-left: 0.25rem; }

/* Retry processing button - minimal style with rotating arrow */
.retry-processing-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.3s ease;
    margin: 0;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    flex-shrink: 0;
}

.retry-processing-btn:hover {
    color: #475569;
}

.retry-processing-btn .rotating-arrow {
    transition: transform 0.3s ease;
}

.retry-processing-btn:active .rotating-arrow {
    transform: rotate(180deg);
}

/* Override: Incoming delete button should match processed card button and have no animations */
.incoming-delete-btn {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    border: 1px solid var(--border-color);
    color: var(--text-color-light);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: none;
    margin-right: 0; /* keep on the right side with text */
}
.incoming-delete-btn:hover {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    color: var(--text-color-light);
    border-color: var(--border-color);
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.incoming-delete-btn svg { width: 14px; height: 14px; transition: none; }
.incoming-item:hover .incoming-delete-btn { transform: none; }
.incoming-delete-btn:hover svg { transform: none; }

/* API Key Management Styles */
.add-api-section {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.add-api-section h4 {
  margin: 0 0 1rem 0;
  color: #495057;
  font-size: 1.1rem;
}

#add-api-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#new-api-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
}

#add-api-form button {
  padding: 0.5rem 1rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

#add-api-form button:hover {
  background: #0056b3;
}

.api-management-section {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.api-management-section h4 {
  margin: 0 0 1rem 0;
  color: #495057;
  font-size: 1.1rem;
}

.queue-status-info {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.queue-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-label {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
}

.queue-value {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}

.queue-value.running {
  color: #28a745;
}

.queue-value.stopped {
  color: #dc3545;
}

.api-list {
  max-height: 300px;
  overflow-y: auto;
}

.api-key-item {
  position: relative;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.api-key-item.user {
  border-left: 4px solid #007bff;
}

.api-key-item.system {
  border-left: 4px solid #6c757d;
}

.api-key-item.active {
  background: #e3f2fd;
  border-color: #2196f3;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.api-key-item.cooldown {
  background: #fff3e0;
  border-color: #ff9800;
}

.api-key-item.queue {
  background: #e8f5e8;
  border-color: #4caf50;
}

.api-key-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.api-key-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-key-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.api-key-value {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #495057;
  font-weight: 500;
}

.api-key-type {
  font-size: 12px;
  color: #6c757d;
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 12px;
}

.active-badge {
  background: #4caf50;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
}

.cooldown-badge {
  background: #ff9800;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
}

.queue-badge {
  background: #2196f3;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
}

.api-key-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11px;
  color: #6c757d;
  font-weight: 500;
}

.stat-value {
  font-size: 13px;
  color: #495057;
  font-weight: 600;
}

.stat-value.no-data {
  color: #adb5bd;
  font-style: italic;
}

.api-key-quotas {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quota-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quota-label {
  font-size: 12px;
  color: #495057;
  font-weight: 500;
}

.quota-count {
  font-size: 12px;
  color: #6c757d;
  font-family: monospace;
}

.quota-bar {
  width: 100%;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.remove-api-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.remove-api-btn:hover {
  background: #c82333;
}

.api-key-reset-time {
  font-size: 10px;
  color: #adb5bd;
  font-family: monospace;
}

/* استایل فیلد تعداد اخبار در کارت کلیدواژه */
.news-count-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-color-light);
}

.news-count-info label {
    font-weight: 500;
}

.news-count-input {
    width: 60px !important;
    padding: 4px 6px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    font-size: 11px !important;
    text-align: center !important;
}

.news-count-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2) !important;
    outline: none !important;
}

/* Source Management Modal Styles */
.source-tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 2rem;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 2rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  flex: 1;
  text-align: center;
}

.tab-btn:hover {
  color: #333;
  background-color: #e9ecef;
}

.tab-btn.active {
  color: #4CAF50;
  border-bottom-color: #4CAF50;
  background-color: white;
  font-weight: 600;
}

.tab-content {
  display: none;
  animation: fadeInContent 0.3s ease-in-out;
}

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

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

.source-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.source-item:hover {
  background: linear-gradient(135deg, #f0f0f0 0%, #e9ecef 100%);
  border-color: #4CAF50;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.15);
}

.source-info h5 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.source-info p {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.source-status {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.source-status.active {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.source-status.inactive {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

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

.source-actions button {
  padding: 0.6rem 1.2rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  color: #333;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.source-actions button:hover {
  background: #f8f9fa;
  border-color: #4CAF50;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.edit-source-btn:hover {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  border-color: #2196F3;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.test-source-btn:hover {
  background: linear-gradient(135deg, #FF9800, #F57C00);
  color: white;
  border-color: #FF9800;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.toggle-source-btn:hover {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border-color: #4CAF50;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.delete-source-btn:hover {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  border-color: #f44336;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.add-source-section {
  margin-top: 2.5rem;
  padding: 2rem;
  border: 2px dashed #4CAF50;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
  overflow: hidden;
}

.add-source-section h5 {
  margin: 0 0 1.5rem 0;
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #666;
  font-style: italic;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 2px dashed #ddd;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

/* Source Tags in Incoming News */
.news-item-footer .source-tag {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.news-item-footer .api-source-tag {
  background-color: #4CAF50 !important;
  color: white !important;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

.news-item-footer .keyword-tag {
  background-color: #2196F3 !important;
  color: white !important;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

.news-item-footer .source-chip {
  background-color: #f0f0f0;
  color: #333;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}

/* Sample Article Card Styles */
.sample-article-card {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 2px solid #4CAF50;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  animation: slideInFromBottom 0.3s ease-out;
}

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

.sample-article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e0e0e0;
}

.sample-article-header h4 {
  margin: 0;
  color: #333;
  font-size: 1.1rem;
  font-weight: 600;
}

.close-sample-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-sample-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.sample-news-card {
  display: flex;
  gap: 1rem;
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.sample-news-image {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
}

.sample-news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample-news-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sample-news-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sample-news-description {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sample-news-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: #888;
  margin-top: auto;
}

.sample-news-date {
  font-weight: 500;
}

.sample-news-source {
  background: #f0f0f0;
  color: #333;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.sample-news-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}

.sample-news-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #4CAF50;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sample-news-link:hover {
  color: #45a049;
  text-decoration: underline;
}

.sample-news-link svg {
  width: 14px;
  height: 14px;
}

/* Test Message Styles */
.test-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeInMessage 0.3s ease-out;
}

.test-message-text {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.test-message-details {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.8;
  line-height: 1.4;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes fadeInMessage {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.test-message-info {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.test-message-success {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.test-message-success .test-message-details {
  border-top-color: rgba(46, 125, 50, 0.2);
}

.test-message-warning {
  background: #fff3e0;
  color: #f57c00;
  border: 1px solid #ffcc02;
}

.test-message-warning .test-message-details {
  border-top-color: rgba(245, 124, 0, 0.2);
}

.test-message-error {
  background: #ffebee;
  color: #d32f2f;
  border: 1px solid #ffcdd2;
}

.test-message-error .test-message-details {
  border-top-color: rgba(211, 47, 47, 0.2);
}

/* Clear News Popup Styles */
.clear-news-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.clear-news-popup-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.clear-news-popup h3 {
  margin: 0 0 1.5rem 0;
  color: #333;
  font-size: 1.3rem;
}

.clear-news-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.clear-news-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-news-option:hover {
  border-color: #4CAF50;
  background-color: #f8f9fa;
}

.clear-news-option.selected {
  border-color: #4CAF50;
  background-color: #e8f5e8;
}

.clear-news-option input[type="checkbox"] {
  margin-left: 1rem;
  transform: scale(1.2);
}

.clear-news-option label {
  flex: 1;
  cursor: pointer;
  font-weight: 500;
  color: #333;
}

.clear-news-popup-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.clear-news-popup-actions button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-news-confirm-btn {
  background-color: #4CAF50;
  color: white;
}

.clear-news-confirm-btn:hover {
  background-color: #45a049;
}

.clear-news-cancel-btn {
  background-color: #f44336;
  color: white;
}

.clear-news-cancel-btn:hover {
  background-color: #da190b;
}

/* Editorial Modal Styles */
.image-upload-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  position: relative;
  overflow: hidden;
}

.image-upload-area:hover {
  border-color: #4CAF50;
  background: linear-gradient(135deg, #e8f5e8, #d4edda);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.image-upload-area.dragover {
  border-color: #4CAF50;
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  transform: scale(1.02);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #666;
}

.upload-placeholder svg {
  color: #4CAF50;
  transition: transform 0.3s ease;
}

.image-upload-area:hover .upload-placeholder svg {
  transform: scale(1.1);
}

.upload-hint {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.5rem;
}

.image-url-input {
  margin-top: 0.5rem;
}

.image-url-input input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.image-url-input input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.image-preview {
  position: relative;
  margin-top: 1rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-preview img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.remove-image-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.remove-image-btn:hover {
  background: rgba(220, 38, 38, 0.9);
  transform: scale(1.1);
}

.destination-selector {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.destination-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #fafafa, #f5f5f5);
}

.destination-option:hover {
  border-color: #4CAF50;
  background: linear-gradient(135deg, #e8f5e8, #d4edda);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.destination-option input[type="radio"] {
  margin: 0;
  transform: scale(1.2);
  accent-color: #4CAF50;
}

.destination-option:has(input:checked) {
  border-color: #4CAF50;
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.destination-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.destination-label strong {
  color: #333;
  font-size: 1rem;
  font-weight: 600;
}

.destination-label small {
  color: #666;
  font-size: 0.85rem;
}

.secondary {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.secondary:hover {
  background: linear-gradient(135deg, #5a6268, #495057);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Responsive Design for Editorial Modal */
@media (max-width: 768px) {
  .destination-selector {
    gap: 0.75rem;
  }
  
  .destination-option {
    padding: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .destination-label {
    width: 100%;
  }
  
  .image-upload-area {
    padding: 1.5rem;
  }
  
  .upload-placeholder p {
    font-size: 0.9rem;
  }
  
  .upload-hint {
    font-size: 0.75rem;
  }
}