/* Timeframe Controls Styling */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem auto;
    width: 90%;
    position: relative;
    z-index: 2;
}

.timeframe-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeframe-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 90px;
    text-align: center;
    color: white;
}

.timeframe-btn[data-timeframe="1d"] {
    background: #dc3545;
}

.timeframe-btn[data-timeframe="15m"] {
    background: #9BCD9B;
}

.timeframe-btn[data-timeframe="1h"] {
    background: #007bff;
}

.timeframe-btn[data-timeframe="4h"] {
    background: #ffc107;
}

.timeframe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.timeframe-btn.active {
    opacity: 0.8;
}

/* Filter Form */
.filter-condition {
    position: relative;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.filter-condition:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.filter-condition.main-condition {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    border-left: 3px solid #0d6efd;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.filter-group select,
.filter-group input {
    height: 32px;
    padding: 4px 8px;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.filter-group select:hover,
.filter-group input:hover {
    border-color: #adb5bd;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.15);
    outline: none;
}

.filter-indicator {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.filter-operator {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.filter-value {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.logical-operator select {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    background-color: #f8f9fa;
}

.remove-condition {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #dc3545;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.remove-condition:hover {
    opacity: 1;
}

/* Action Buttons */
#addCondition,
#applyFilter {
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#addCondition {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

#addCondition:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

#applyFilter {
    background-color: #0d6efd;
    border: 1px solid #0d6efd;
    color: white;
}

#applyFilter:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Results Table */
#resultsTable {
    margin-top: 20px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

#resultsTable th {
    background-color: #f8f9fa;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-bottom: 2px solid #dee2e6;
}

#resultsTable td {
    padding: 6px 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid #dee2e6;
}

.signal-long {
    color: #198754;
    font-weight: 500;
}

.signal-short {
    color: #dc3545;
    font-weight: 500;
}

.signal-neutral {
    color: #6c757d;
}

/* Loading State */
#resultsTable.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Symbol-Dropdown-Styling */
.symbol-dropdown {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-top: 4px;
}

.symbol-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.symbol-option:hover,
.symbol-option.selected {
    background-color: #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-group {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .filter-group select,
    .filter-group input {
        width: calc(50% - 3px);
        max-width: none;
    }
    
    .logical-operator select {
        width: 100%;
        max-width: none;
    }
    
    .timeframe-buttons {
        flex-wrap: wrap;
    }
    
    .timeframe-buttons button {
        flex: 1 1 calc(50% - 4px);
    }
}

.filter-condition.main-condition {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.filter-condition.main-condition .filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-condition.main-condition .filter-indicator {
    /* allow normal look and behavior for first condition dropdown */
    background-color: #fff;
    font-weight: bold;
}

.filter-condition.main-condition .filter-value {
    width: 120px;
    text-align: center;
    font-weight: bold;
} 

/* --- Compact filter grid & color chips overrides --- */
/* grid: max 3 per row, responsive */
#filterConditions { display:grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap:12px; align-items:start; }
@media (max-width: 1200px){ #filterConditions { grid-template-columns: repeat(2, minmax(280px, 1fr)); } }
@media (max-width: 768px){ #filterConditions { grid-template-columns: 1fr; } }

/* card layout */
.filter-condition { position:relative; margin:0; padding:10px 12px 12px 12px; border:1px solid #e5e7eb; border-radius:10px; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.chip-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.indicator-name { color:#0d6efd; font-weight:700; font-size:0.95rem; }

/* move logic toggle into flow */
.logical-operator-container { position:static; }
.logical-operator-container .form-select { display:none; }
.logic-toggle { display:inline-flex; gap:4px; padding:2px; border-radius:16px; background:#f0f2f5; border:1px solid #d0d7de; }
.logic-btn { appearance:none; border:none; background:transparent; padding:4px 12px; font-size:12px; font-weight:700; border-radius:14px; cursor:pointer; color:#34495e; }
.logic-btn.and.active { background:#28a745; color:#fff; }
.logic-btn.or.active { background:#dc3545; color:#fff; }

/* inputs grid */
.filter-group { display:grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap:8px; align-items:center; }

/* stronger tones */
.condition-chip.chip-long { border-left:5px solid #20c997; background:#e9f7ef; }
.condition-chip.chip-short { border-left:5px solid #e55353; background:#fdebec; }
.condition-chip.chip-neutral { border-left:5px solid #ffca2c; background:#fff7d6; }

/* remove button top-left */
.remove-condition { position:absolute; left:8px; top:8px; cursor:pointer; color:#dc3545; font-size:0.9rem; opacity:0.75; padding:2px 6px; border-radius:4px; }
.remove-condition:hover { opacity:1; }

/* value color helpers */
.select-long { color: #198754; font-weight: 600; }
.select-short { color: #dc3545; font-weight: 600; }
.select-neutral { color: #a97900; font-weight: 600; } 

/* --- Enhanced chip visuals and AND/OR toggle --- */
/* stronger chip tones */
.condition-chip.chip-long { border-left: 5px solid #20c997; background-color: #e9f7ef; }
.condition-chip.chip-short { border-left: 5px solid #e55353; background-color: #fdebec; }
.condition-chip.chip-neutral { border-left: 5px solid #ffca2c; background-color: #fff7d6; }

/* stronger select coloring for signals */
.select-long { color:#198754; background:#e9f7ef; border-color:#19875433; }
.select-short { color:#dc3545; background:#fdebec; border-color:#dc354533; }
.select-neutral { color:#a97900; background:#fff3cd; border-color:#ffe69c; } 

/* prevent overlap of logic toggle */
.filter-condition { overflow: visible; }
.logic-toggle { z-index: 1; }
.filter-group { position: relative; z-index: 0; } 