* {
    box-sizing: border-box;
}
html, body {
    height: 100%;
    min-height: 100%; 
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    overflow-x: hidden; 
/*     user-select: none; */
}
.app-container {
    display: flex;
    height: 100vh;
    width: 100%; 
    overflow-x: hidden; 
}
.filter-panel {
    background: #2d2d2d;
    padding: 20px 20px 0 20px;
    border-right: 1px solid #404040;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 350px; 
    position: static; 
    transition: transform 0.3s ease-in-out;
}
.filter-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffd700;
    text-align: center;
}
.exchange-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
.exchange-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #3a3a3a;
    border-radius: 8px;
    transition: background 0.3s, border-color 0.3s;
    border: 1px solid transparent;
}
.exchange-checkbox {
    margin-right: 0;
    transform: scale(1.1);
    cursor: pointer;
}
.exchange-name {
    flex: 1;
    cursor: pointer;
    font-size: 1.1em;
}
.candle-interval-select {
    padding: 6px 10px;
    background: #555;
    border: 1px solid #666;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    min-width: 90px;
    text-align: center;
}
.candle-interval-select:disabled {
    background: #4a4a4a;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}
.exclusion-section {
    border-top: 1px solid #404040;
    padding-top: 25px;
}
.exclusion-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}
.exclusion-checkbox {
    margin-right: 10px;
    transform: scale(1.1);
    cursor: pointer;
}
.candle-section {
    border-top: 1px solid #404040;
    padding-top: 25px;
}
.candle-title {
    font-weight: bold;
    margin-bottom: 15px;
    color: #ffd700;
}
.condition-radio-group {
    margin-bottom: 15px;
    padding: 15px;
    background: #3a3a3a;
    border-radius: 8px;
    border: 1px solid #555;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.radio-item {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}
.radio-item:last-child {
    margin-bottom: 0;
}
input:checked {
    accent-color: #ffd700;
}
.radio-input {
    margin-right: 10px;
    transform: scale(1.1);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}
.radio-label {
    cursor: pointer;
    line-height: 1.4;
    font-size: 1.05em;
}
.radio-description {
    font-size: 0.8em;
    color: #b0b0b0;
    margin-top: 2px;
    line-height: 1.2;
}
.input-label {
    display: block;
    margin-bottom: 8px;
    color: #cccccc;
    font-size: 0.95em;
}
.input-field {
    width: 100%;
    padding: 10px 12px;
    background: #4a4a4a;
    border: 1px solid #555;
    border-radius: 5px;
    color: white;
    cursor: text;
    font-size: 1em;
}
.input-field:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}
.input-field[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.input-field::-webkit-inner-spin-button,
.input-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M6%209L0%203h12z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.button-group {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #404040;
    position: sticky;
    bottom: 0;
    background: #2d2d2d;
    z-index: 10;
    padding-bottom: 20px;
}
.scan-button {
    width: auto;
    padding: 10px 20px;
    background: #ffd700;
    color: #3a3a3a;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.scan-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.scan-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.scan-button.scanning {
    background: #555;
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
    animation: none;
}
.results-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    height: 100%;
}
.initial-display {
    max-width: 600px;
    margin: auto;
    padding: 30px;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
}
.initial-display h2 {
    font-size: 2.2em;
    color: #ffd700;
    margin-bottom: 20px;
}
.initial-display p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
}
.copyright-info {
    margin-top: auto;
    padding-top: 15px;
    font-size: 0.85em;
    color: #888;
    border-top: 1px solid #444;
    width: 100%;
}
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: #2d2d2d;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}
.results-table th,
.results-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #404040;
}
.results-table th {
    background: #3a3a3a;
    color: #ffd700;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.results-table tr {
    cursor: pointer;
    transition: all 0.2s;
}
.results-table tr:nth-child(even) {
    background-color: #282828;
}
.results-table tr:hover {
    background: #3a3a3a;
    transform: scale(1.005);
}
.results-table tr.selected {
    background: #4a4a4a;
    border-left: 5px solid #ffd700;
}
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    min-height: 200px;
    margin-top: 20px;
    width: 100%;
}
.loading h2 {
    margin-bottom: 20px;
    font-size: 28px;
    color: #ffd700;
}
.loading p {
    font-size: 16px;
    color: #cccccc;
}
.progress-container {
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    color: #f0f0f0;
    width: 100% !important;
    overflow: hidden;
}
.progress-header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}
.progress-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: auto;
    margin-right: 15px;
}
.progress-status {
    font-size: 0.9em;
    color: #b0b0b0;
    white-space: nowrap;
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: auto;
    text-align: right;
}
.progress-bar {
    width: 100%;
    background-color: #333;
    border-radius: 8px;
    height: 18px;
    overflow: hidden;
    margin-bottom: 20px;
}
.progress-fill {
    height: 100%;
    background-color: #66BB6A;
    border-radius: 8px;
    transition: width 0.5s ease-in-out;
}
.progress-details {
    max-height: 350px;
    overflow-y: auto;
    padding: 0 10px;
    scrollbar-width: thin;
    scrollbar-color: #66BB6A #333;
    margin-top: 0;
}
.progress-details::-webkit-scrollbar {
    width: 8px;
}
.progress-details::-webkit-scrollbar-track {
    background: #333;
    border-radius: 10px;
}
.progress-details::-webkit-scrollbar-thumb {
    background-color: #66BB6A;
    border-radius: 10px;
    border: 2px solid #333;
}
.progress-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 12px;
    font-size: 0.95em;
    color: #e0e0e0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.progress-detail-item:hover {
    background-color: #353535;
    transform: translateY(-2px);
}
.progress-detail-item .pair-name {
    font-weight: bold;
    color: #ffffff;
    flex-grow: 1;
    margin-right: 15px;
    text-align: left;
}
.progress-detail-item .status-message {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85em;
    color: #ffffff;
    min-width: 100px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.status-processing {
    background-color: #42A5F5;
}
.status-success {
    background-color: #66BB6A;
}
.status-failure {
    background-color: #EF5350;
}
.status-skipped {
    background-color: #78909C;
}
.status-satisfied-success {
    background-color: #66BB6A;
}
.status-unsatisfied-success {
    background-color: #EF5350;
}
.hidden {
    display: none !important;
}
.success-message {
    background: #4CAF50;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.exchange-item.selected {
    background: #4a4a4a;
    border: 1px solid #ffd700;
}
.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}
.chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000; 
    display: none;
    justify-content: center;
    align-items: center;
}
.chart-modal.show {
    display: flex;
}
.chart-container {
    background: #2d2d2d;
    border-radius: 10px;
    padding: 10px;
    max-width: 100%; 
    max-height: 100%; 
    overflow: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #555;
}
.chart-title {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
}
.close-chart {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}
.close-chart:hover {
    background: #d32f2f;
}
.chart-info {
    display: flex;
    flex-wrap: wrap;
    max-width: 700px; 
    gap: 15px 25px;
    margin-bottom: 20px;
    padding: 15px;
    background: #3a3a3a;
    border-radius: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid #555;
}
.chart-info span {
    color: #e0e0e0;
}
.chart-info span span {
    font-weight: bold;
    color: #ffd700;
}
.candlestick-chart {
    background: #1e1e1e;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 1px solid #404040;
    flex-grow: 1;
    min-height: 0;
    width: 100%; 
}
.chart-legend {
    margin-top: 20px;
    text-align: center;
    color: #cccccc;
}
.legend-item {
    display: inline-block;
    margin: 0 15px;
}
.legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 3px;
}
.legend-green {
    background: #4CAF50;
}
.legend-red {
    background: #f44336;
}
.legend-highlight {
    background: #ffd700;
}
.candle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.candle-table th,
.candle-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #555;
}
.candle-table th {
    background: #404040;
    color: #ffd700;
    font-weight: bold;
}
.candle-table tr:nth-child(even) {
    background: #2d2d2d;
}
.candle-table tr:hover {
    background: #4a4a4a;
}
.candle-table .highlighted {
    background: #2d5a2d !important;
    border: 2px solid #ffd700;
}
.time-label {
    fill: #ccc;
    font-size: 10px;
}
.time-label.highlighted {
    fill: #ffd700 !important;
    font-weight: bold;
}
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    max-width: 350px;
}
.toast {
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 0;
    transform: translateX(100%);
    width: 250px;
    text-align: center;
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}
.toast.info {
    background-color: #2196F3;
}
.toast.success {
    background-color: #4CAF50;
}
.toast.error {
    background-color: #f44336;
}
.view-live-link {
    display: inline-block;
    padding: 8px 12px;
    background-color: #ffd700;
    color: #3a3a3a;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s;
}
.view-live-link:hover {
    transform: translateY(-1px);
}
.filter-toggle-button {
    display: none; 
}
@media (max-width: 620px){
    .results-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        table-layout: fixed; 
        width: 100%; 
    }
}
@media (max-width: 1000px) {
    .loading {
        padding: 20px 0;
    }
    .app-container {
        display: block; 
        height: auto;
    }
    .filter-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw; 
        max-width: 350px; 
        bottom: 0; 
        overflow-y: auto; 
        transform: translateX(-100vw); 
        z-index: 1000; 
        padding-top: 60px; 
        border-right: 1px solid #404040;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5); 
        flex-shrink: 0; 
    }
    .filter-panel.show-on-mobile {
        transform: translateX(0); 
    }
    .filter-toggle-button {
        display: block; 
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001; 
        padding: 12px 18px; 
        background: #ffd700;
        color: #3a3a3a;
        border: 1px solid #ffcc00; 
        border-radius: 8px; 
        font-size: 16px; 
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); 
        transition: all 0.2s ease; 
    }
    .results-area {
        padding-top: 60px; 
        width: 100%;
        margin-left: 0;
    }
    .results-table thead {
        display: table-header-group;
    }
    .results-table tbody {
        display: table-row-group;
    }
    .results-table th, .results-table td {
        display: table-cell; 
        text-align: left;
        padding: 10px;
        width: auto; 
    }
    .results-table tr {
        display: table-row;
    }
    .results-table td {
        border-bottom: 1px solid #404040;
    }
    .chart-container {
        padding: 5px;
        max-width: 100%;
        max-height: 100%;
    }
    .chart-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    .chart-title {
        font-size: 20px;
    }
    .close-chart {
        width: 100%;
    }
    .chart-info {
        grid-template-columns: 1fr;
        font-size: 12px;
        gap: 10px;
        padding: 10px;
    }
    .progress-header {
        flex-direction: column; 
        align-items: flex-start;
    }
    .progress-title {
        margin-right: 0;
        margin-bottom: 5px; 
    }
    .progress-detail-item {
        align-items: flex-start;
    }
    .progress-detail-item .pair-name {
        margin-right: 0;
        margin-bottom: 5px; 
    }
}
