/* --- Общие стили для Fixture Finder --- */
#fixture-finder-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1c1c1c;
    color: #f0f0f0;
    margin: 20px auto;
    padding: 20px;
    max-width: 900px;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
}

.ff-header {
    padding: 20px 25px;
    border-bottom: 2px solid #f43d00;
}

.ff-header h2 {
    margin: 0;
    color: #ffffff;
}

.ff-body {
    padding: 25px;
}

.ff-section {
    margin-bottom: 25px;
}

.ff-section h3 {
    color: #f0f0f0;
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
}

/* --- Элементы формы (темная тема) --- */
#fixture-finder-container input[type="text"],
#fixture-finder-container input[type="number"],
#fixture-finder-container select {
    background-color: #333;
    color: #f0f0f0;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

#fixture-finder-container input[type="text"]::placeholder {
    color: #888;
}

/* --- Стиль для SELECT, чтобы разместить иконку --- */
#fixture-finder-container select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23f43d00" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 40px;
}

/* --- Сетка для полей ввода --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.form-row-flex {
    display: flex;
    gap: 10px;
    align-items: center;
}
.form-row-flex input {
    flex-grow: 1;
}

/* --- Кнопки --- */
.ff-button {
    border: none;
    padding: 12px 18px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    text-align: center;
}

.button-primary {
    background-color: #f43d00;
    color: #ffffff;
}
.button-primary:hover {
    background-color: #d03300;
}

.button-secondary {
    background-color: #555;
    color: #ffffff;
}
.button-secondary:hover {
    background-color: #666;
}

.button-small {
    padding: 5px 8px;
    font-size: 12px;
}

/* --- Секция фильтров по каналам --- */
.channel-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.channel-filters-header span {
    font-size: 18px;
    font-weight: bold;
    color: #f43d00;
}

.channel-row {
    display: grid;
    grid-template-columns: 100px 1fr 100px 100px; /* №, функция, +пресет, X */
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #303030;
    border-radius: 4px;
}

.channel-row label {
    font-weight: bold;
    color: #ccc;
}

/* --- "Как бы" раскрытый блок с пресетами --- */
.preset-details {
    background-color: #3a3a3a;
    border-radius: 4px;
    margin: 0 10px 10px 10px;
    padding: 15px;
}

.preset-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.preset-details-header h4 {
    margin: 0;
    color: #fff;
}

.preset-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 50px; /* от, до, имя, X */
    gap: 10px;
    align-items: center;
    margin-bottom: 5px;
}

/* --- Секция результатов --- */
#results-section {
    border-top: 1px solid #444;
    padding-top: 20px;
}

.result-card {
    background-color: #303030;
    border-radius: 5px;
    margin-bottom: 20px;
    padding: 20px;
    border-left: 4px solid #f43d00;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 1.2em;
}

.result-header .mode-info {
    background-color: #444;
    color: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.result-body .info-path {
    background-color: #1c1c1c;
    color: #ccc;
    padding: 10px;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
    margin-bottom: 15px;
}

.result-body .preset-match-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 15px 0;
    border-top: 1px solid #444;
    padding-top: 10px;
}

.result-body .preset-match-list li {
    padding: 5px 0;
    font-size: 0.95em;
}

.result-body .preset-match-list li code {
    background: #444;
    padding: 2px 4px;
    border-radius: 3px;
    color: #f43d00;
    font-weight: bold;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.related-tag {
    background-color: #f43d00;
    color: #fff;
    font-size: 0.8em;
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-block;
}

/* Адаптивность */
@media (max-width: 600px) {
    .form-grid, .channel-row, .preset-row, .result-footer {
        grid-template-columns: 1fr;
    }

    .channel-row {
        grid-template-columns: 80px 1fr;
    }

    .channel-row .details-button {
        grid-column: 1 / -1;
        text-align: right;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .form-row-flex {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Стили для загрузки */
#ff-results-container .loading {
    text-align: center;
    padding: 20px;
    color: #aaa;
}

/* Стили для ошибки */
#ff-results-container .error {
    color: #ff6b6b;
    padding: 10px;
    background-color: #402a2a;
    border-radius: 4px;
    margin: 10px 0;
}

/* Стили для отсутствия результатов */
#ff-results-container .no-results {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 1.1em;
}

#ff-results-container .no-results a {
    color: #f43d00;
    text-decoration: none;
}

#ff-results-container .no-results a:hover {
    text-decoration: underline;
}