/* Добавьте это в style.css */

body, html, .google-suggest-tool, #results-area, #queue-visualization {
    overflow-anchor: none !important;
}

#queue-visualization {
    contain: content; 
}

.queue-item.active { 
    font-weight: normal !important; 
    background-color: #e3f2fd; 
    color: #007bff;
    border-left: 4px solid #007bff; 
}

/* Новый стиль для счетчиков ввода */
.input-count-badge {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
    margin-right: 5px; /* Отступ справа для RTL (или слева для LTR) */
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

.google-suggest-tool {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    direction: rtl;
    text-align: right;
}

.google-suggest-tool h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
}

.google-suggest-tool h4 {
    color: #555;
    margin-top: 20px;
    margin-bottom: 10px;
}

.google-suggest-tool label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #444;
}

.google-suggest-tool textarea,
.google-suggest-tool select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.google-suggest-tool textarea {
    resize: vertical;
    min-height: 100px;
}

.google-suggest-tool textarea:focus,
.google-suggest-tool select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.google-suggest-tool .checkboxes {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 4px;
}

.google-suggest-tool .checkboxes label {
    display: inline-block;
    margin-left: 20px;
    margin-right: 0;
    font-weight: normal;
    cursor: pointer;
}

.google-suggest-tool .checkboxes input[type="checkbox"] {
    margin-left: 5px;
    cursor: pointer;
}

.google-suggest-tool .controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.google-suggest-tool button {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.google-suggest-tool .button-start {
    background-color: #28a745;
    color: white;
}

.google-suggest-tool .button-start:hover:not(:disabled) {
    background-color: #218838;
}

.google-suggest-tool .button-start:disabled {
    background-color: #94d3a2;
    cursor: not-allowed;
}

.google-suggest-tool .button-stop {
    background-color: #dc3545;
    color: white;
}

.google-suggest-tool .button-stop:hover {
    background-color: #c82333;
}

.google-suggest-tool #results-area {
    border: 1px solid #ddd;
    min-height: 200px;
    max-height: 500px;
    padding: 15px;
    background: #f9f9f9;
    overflow-y: auto;
    border-radius: 4px;
}

.google-suggest-tool #results-area:empty::before {
    content: "התוצאות יופיעו כאן...";
    color: #999;
    font-style: italic;
}

.google-suggest-tool .suggestion-item {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.google-suggest-tool .suggestion-item:hover {
    background: #f0f8ff;
    border-color: #4CAF50;
    transform: translateX(-3px);
}

.google-suggest-tool [dir="auto"] {
    direction: rtl;
}

@media (max-width: 768px) {
    .google-suggest-tool {
        padding: 15px;
        margin: 10px;
    }
    
    .google-suggest-tool .controls {
        flex-direction: column;
    }
    
    .google-suggest-tool .checkboxes label {
        display: block;
        margin-bottom: 8px;
    }
}

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

#status-semaphore {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ccc; 
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
    transition: background-color 0.3s;
}

#status-semaphore.status-running {
    background-color: #ff4444; 
    box-shadow: 0 0 8px #ff4444;
}

#status-semaphore.status-finished {
    background-color: #00C851; 
    box-shadow: 0 0 8px #00C851;
}

.settings-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.setting-col {
    flex: 1;
}

.controls-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.control-item {
    flex: 1;
}

.export-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 13px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    color: #333;
}

.btn-small:hover {
    background: #e0e0e0;
}

.btn-excel {
    background-color: #217346; 
    color: white;
    border: none;
}

.btn-excel:hover {
    background-color: #1e6b40;
}

.main-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#count-badge {
    background: #eee;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
}

@media (max-width: 600px) {
    .settings-grid, .controls-row {
        flex-direction: column;
        gap: 10px;
    }
}

#queue-visualization {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 0;
    list-style: none;
    display: none; 
}

.queue-item {
    padding: 8px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

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

.queue-item.pending { color: #666; }
.queue-item.active { background-color: #e3f2fd; font-weight: bold; color: #007bff; }
.queue-item.done { background-color: #f0fff4; color: #28a745; }

.status-icon {
    font-weight: bold;
    width: 20px;
    text-align: center;
}
.queue-item.pending .status-icon::after { content: "⏳"; opacity: 0.5; }
.queue-item.active .status-icon::after { content: "🔄"; animation: spin 1s linear infinite; display: inline-block; }
.queue-item.done .status-icon::after { content: "✅"; }

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

.freq-badge {
    background: #6c757d;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 8px;
    vertical-align: middle;
}
.freq-badge.high { background: #dc3545; } 

.google-suggest-tool .button-reset {
    background-color: #6c757d;
    color: white;
}

.google-suggest-tool .button-reset:hover {
    background-color: #5a6268;
}
