/* ETF Comparison Widget - Server-Side Rendered */
.etf-comparison-widget {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.etf-comparison-header {
    margin-bottom: 30px;
}

.etf-comparison-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
}

.etf-comparison-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

/* Preset Buttons */
.etf-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 8px;
}

.etf-presets-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-right: 5px;
}

.etf-preset-btn,
.etf-clear-btn {
    padding: 8px 16px;
    background: #ffffff;
    color: #374151;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.etf-preset-btn:hover {
    background: #e12b2b;
    color: #ffffff;
    border-color: #e12b2b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(225, 43, 43, 0.2);
}

.etf-clear-btn {
    background: #64748b;
    color: #ffffff;
    border-color: #64748b;
}

.etf-clear-btn:hover {
    background: #475569;
    color: #ffffff;
    border-color: #475569;
}

/* Search Form */
.etf-search-form {
    background: #f8fafc;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.etf-search-form form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.etf-select-group {
    flex: 1;
    min-width: 200px;
}

.etf-select-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.etf-select-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.etf-select-group select:focus {
    border-color: #e12b2b;
    box-shadow: 0 0 0 3px rgba(225, 43, 43, 0.1);
}

.etf-compare-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #e12b2b 0%, #c22626 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.etf-compare-btn:hover {
    background: linear-gradient(135deg, #c22626 0%, #a82222 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(225, 43, 43, 0.3);
}

.etf-compare-btn:active {
    transform: translateY(0);
}

/* Comparison Results */
.etf-comparison-results {
    margin-top: 30px;
}

.etf-results-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.etf-results-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.etf-results-empty p {
    font-size: 16px;
    margin: 0;
}

/* Comparison Table */
.etf-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.etf-comparison-table thead {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.etf-comparison-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e12b2b;
}

.etf-comparison-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.etf-comparison-table tbody tr:hover {
    background-color: #f8fafc;
}

.etf-comparison-table tbody tr:last-child {
    border-bottom: none;
}

.etf-comparison-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: #1e293b;
}

.etf-ticker {
    font-weight: 700;
    color: #e12b2b;
    font-size: 15px;
}

.etf-time {
    color: #64748b;
    font-size: 13px;
}

.etf-price {
    font-weight: 600;
    color: #1a1a1a;
}

.etf-change-positive {
    color: #10b981;
    font-weight: 600;
}

.etf-change-negative {
    color: #ef4444;
    font-weight: 600;
}

.etf-change-neutral {
    color: #64748b;
    font-weight: 600;
}

/* Summary Cards */
.etf-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.etf-summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.etf-summary-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.etf-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.etf-summary-ticker {
    font-size: 14px;
    color: #e12b2b;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .etf-comparison-widget {
        padding: 20px;
    }

    .etf-comparison-header h2 {
        font-size: 24px;
    }

    .etf-search-form form {
        flex-direction: column;
    }

    .etf-select-group {
        width: 100%;
    }

    .etf-compare-btn {
        width: 100%;
    }

    .etf-comparison-table {
        font-size: 13px;
    }

    .etf-comparison-table th,
    .etf-comparison-table td {
        padding: 12px 10px;
    }

    .etf-summary-cards {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.etf-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.etf-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #e12b2b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Data Info */
.etf-data-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 20px;
    font-size: 13px;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 8px;
}

.etf-data-info::before {
    content: "ℹ";
    font-size: 18px;
    font-weight: bold;
}
