/* CSS for Coins List & Market Data */

/* Table Styles */
.price-flash {
    background-color: rgba(240, 185, 11, 0.3);
    transition: background-color 1s ease-out;
}

.coin-symbol {
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.coin-symbol:hover {
    color: var(--accent-color);
}

.coins-table tr {
    transition: background-color 0.2s ease;
}

.coins-table tr.selected {
    background: rgba(240, 185, 11, 0.1);
    border-left: 3px solid var(--accent-color);
}

.price-change-positive {
    color: var(--success-color);
}

.price-change-negative {
    color: var(--error-color);
}

.volume-change-positive {
    color: var(--success-color);
}

.volume-change-negative {
    color: var(--error-color);
}

.volume-change-cell {
    font-weight: 500;
}

.volume-change-loading {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9em;
}

/* Sortable Columns */
.sortable {
    position: relative;
    cursor: pointer;
}

.sortable:after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.sortable.sort-asc:after {
    border-bottom: 4px solid var(--text-secondary);
    border-top: none;
}

.sortable.sort-desc:after {
    border-top: 4px solid var(--text-secondary);
    border-bottom: none;
}

/* Loading and Error States */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

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

.error-message {
    background-color: rgba(246, 70, 93, 0.2);
    color: var(--error-color);
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
    display: none;
}

/* Filter Controls */
.symbol-filter-container {
    position: relative;
    display: flex;
    align-items: center;
}

.clear-symbol-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 16px;
    height: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.clear-symbol-btn:hover {
    color: var(--text-primary);
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.2);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #666;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .coins-table th,
    .coins-table td {
        padding: 10px 8px; /* Increased from 6px 4px */
        font-size: 15px; /* Increased from 13px */
    }
    
    .coin-symbol {
        font-size: 15px; /* Increased from 13px */
    }
}

@media (max-width: 600px) {
    .coins-table th,
    .coins-table td {
        padding: 8px 6px; /* Increased from 4px 2px */
        font-size: 14px; /* Increased from 12px */
    }
}

/* iPad and Tablet Landscape Adjustments */
@media screen and (max-height: 800px) and (min-width: 1000px) {
    .filters-bar {
        padding: 6px var(--padding-md);
        min-height: 40px;
        gap: 6px;
    }
    
    .filter-group label {
        font-size: 10px;
    }
    
    .filter-group select,
    .filter-group input {
        padding: 2px 4px;
        font-size: 10px;
        min-width: 40px;
    }
    
    #stock-select {
        min-width: 60px;
    }
    
    #symbol-filter {
        min-width: 40px;
        width: 40px;
    }
    
    #volume-filter {
        min-width: 35px;
        width: 35px;
    }
    
    .refresh-btn {
        padding: 3px 6px;
        font-size: 12px;
        min-width: 28px;
        height: 24px;
    }
    
    .coins-table {
        font-size: 12px;
    }
    
    .coins-table th,
    .coins-table td {
        padding: 8px 6px;
    }
    
    .coins-table th {
        font-size: 11px;
    }
}

/* iPad mini landscape specific */
@media screen and (max-height: 780px) and (min-width: 1000px) and (max-width: 1200px) {
    .filters-bar {
        padding: 4px 8px;
        min-height: 36px;
        gap: 4px;
    }
    
    .filter-group label {
        font-size: 9px;
    }
    
    .filter-group select,
    .filter-group input {
        padding: 2px 3px;
        font-size: 9px;
    }
    
    #stock-select {
        min-width: 55px;
    }
    
    #symbol-filter {
        min-width: 35px;
        width: 35px;
        padding-right: 16px;
    }
    
    #volume-filter {
        min-width: 30px;
        width: 30px;
    }
    
    .refresh-btn {
        padding: 2px 4px;
        font-size: 11px;
        min-width: 24px;
        height: 20px;
    }
    
    .clear-symbol-btn {
        right: 2px;
        font-size: 10px;
    }
    
    .coins-table th,
    .coins-table td {
        padding: 6px 4px;
    }
    
    .coins-table {
        font-size: 11px;
    }
}

/* Mobile Optimizations */
@media screen and (max-width: 768px) {
    .filters-bar {
        padding: 12px 16px; /* Increased from 8px 12px */
        min-height: 56px; /* Increased from 48px */
        gap: 10px; /* Increased from 8px */
        flex-wrap: wrap;
    }
    
    .filter-group {
        gap: 6px; /* Increased from 4px */
    }
    
    .filter-group label {
        font-size: 14px; /* Increased from 12px */
    }
    
    .filter-group select,
    .filter-group input {
        padding: 8px 10px; /* Increased from 6px 8px */
        font-size: 14px; /* Increased from 12px */
        min-width: 70px; /* Increased from 60px */
        height: 40px; /* Increased height */
    }
    
    #stock-select {
        min-width: 100px; /* Increased from 80px */
    }
    
    #symbol-filter {
        min-width: 80px; /* Increased from 70px */
        width: 80px;
        padding-right: 28px; /* Increased from 24px */
    }
    
    #volume-filter {
        min-width: 60px; /* Increased from 50px */
        width: 60px;
    }
    
    .refresh-btn {
        padding: 8px 12px; /* Increased from 6px 10px */
        font-size: 16px; /* Increased from 14px */
        min-width: 44px; /* Increased from 36px */
        height: 40px; /* Increased from 32px */
    }
    
    .clear-symbol-btn {
        right: 6px; /* Increased from 4px */
        font-size: 14px; /* Increased from 12px */
        width: 22px; /* Increased size */
        height: 22px;
    }
    
    .coins-table {
        font-size: 15px; /* Increased from 13px */
    }
    
    .coins-table th,
    .coins-table td {
        padding: 12px 8px; /* Increased from 8px 6px */
        height: 48px; /* Added explicit height */
    }
    
    .coins-table th {
        font-size: 14px; /* Increased from 12px */
    }
}

/* Small mobile phones */
@media screen and (max-width: 480px) {
    .filters-bar {
        padding: 6px 8px;
        min-height: 44px;
        gap: 6px;
    }
    
    .filter-group label {
        font-size: 11px;
    }
    
    .filter-group select,
    .filter-group input {
        padding: 4px 6px;
        font-size: 11px;
        min-width: 50px;
    }
    
    #stock-select {
        min-width: 70px;
    }
    
    #symbol-filter {
        min-width: 55px;
        width: 55px;
        padding-right: 20px;
    }
    
    #volume-filter {
        min-width: 40px;
        width: 40px;
    }
    
    .refresh-btn {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 32px;
        height: 28px;
    }
    
    .coins-table {
        font-size: 12px;
    }
    
    .coins-table th,
    .coins-table td {
        padding: 6px 4px;
    }
}
