/* Simple signals frontend styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1em;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9em;
}

/* Timeframe Buttons */
.timeframe-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.timeframe-btn {
    padding: 12px 24px;
    border: 2px solid #3498db;
    background: white;
    color: var(--accent-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.timeframe-btn:hover {
    background: #3498db;
    color: white;
}

.timeframe-btn.active {
    background: #3498db;
    color: white;
}

/* Search and Filters Row */
.search-filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
}

#symbol-search {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    text-transform: uppercase;
}

#signal-type-filter {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    background: white;
}

.btn-clear {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-clear:hover {
    background: #7f8c8d;
}

/* Date Controls */
.date-controls {
    border-top: 1px solid #ecf0f1;
    padding-top: 20px;
}

.preset-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.preset-group label {
    margin-right: 10px;
    min-width: 100px;
}

.preset-btn {
    padding: 8px 16px;
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: #d5dbdb;
    border-color: #95a5a6;
}

.preset-btn:active {
    background: #bdc3c7;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-range input[type="date"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.date-separator {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(13, 110, 253, 0.1) !important;
    border-bottom: 1px solid #ecf0f1;
}

.signal-count {
    font-weight: 600;
    color: var(--text-primary);
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ecf0f1;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Table Styles */
.table-container {
    overflow-x: auto;
}

#signals-table {
    width: 100%;
    border-collapse: collapse;
}

#signals-table th {
    background: #34495e;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Center align T1 and T2 columns */
#signals-table th:nth-child(6),
#signals-table th:nth-child(7),
#signals-table td:nth-child(6),
#signals-table td:nth-child(7) {
    text-align: center;
}

#signals-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.signal-row:hover {
    background: rgba(13, 110, 253, 0.1) !important;
}

.symbol-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.symbol-link:hover {
    text-decoration: underline;
}

.timeframe-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.timeframe-badge.daily {
    background: #e8f5e8;
    color: #27ae60;
}

.timeframe-badge.weekly {
    background: #e8f4fd;
    color: var(--accent-color);
}

.timeframe-badge.monthly {
    background: #fdf2e8;
    color: #f39c12;
}

.signal-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.signal-badge.long {
    background: #d5f4e6;
    color: #27ae60;
}

.signal-badge.short {
    background: #fce4e6;
    color: #e74c3c;
}

.loading, .no-data, .error {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.error {
    color: #e74c3c;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(13, 110, 253, 0.1) !important;
    border-top: 1px solid #ecf0f1;
}

.page-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: #2980b9;
}

.page-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.page-info {
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .search-filters-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .timeframe-buttons {
        flex-direction: column;
    }
    
    .preset-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-range {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #signals-table {
        font-size: 0.9em;
    }
    
    #signals-table th,
    #signals-table td {
        padding: 8px 4px;
    }
}

@media (max-width: 480px) {
    .timeframe-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .preset-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    #signals-table {
        font-size: 0.8em;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
}

/* Loading States */
button:disabled,
input:disabled,
select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Smooth Transitions */
* {
    transition: opacity 0.3s ease;
}

/* Focus States */
input:focus,
select:focus,
button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: rgba(13, 110, 253, 0.1) !important;
}

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

.autocomplete-no-results {
    padding: 10px;
    color: #666;
    font-style: italic;
    text-align: center;
}


/* Signal table styling */
.signal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.signal-table th {
    background: rgba(13, 110, 253, 0.1) !important;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.signal-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

.signal-table td#signal-type {
    font-weight: 600;
    text-transform: uppercase;
}

.signal-table tr:hover {
    background: rgba(13, 110, 253, 0.1) !important;
}



/* Price Sort Arrows */
.sortable-price {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable-price:hover {
    background: rgba(52, 73, 94, 0.8) !important;
}

.sort-arrows {
    margin-left: 8px;
    display: inline-block;
    font-size: 10px;
    line-height: 1;
}

.sort-asc,
.sort-desc {
    display: block;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    color: white;
}

.sort-asc:hover,
.sort-desc:hover {
    opacity: 0.7;
}

