/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

h1 {
    font-size: 2.2rem;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.symbol-title {
    color: var(--text-primary);
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
    margin-bottom: 0;
}

/* Watchlist section */
.watchlist-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    border: 1px solid #e1e5e9;
    margin-bottom: 25px;
}

.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.watchlist-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.4rem;
    font-weight: 600;
}

.refresh-btn {
    padding: 8px 16px;
    background-color: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: auto;
}

.refresh-btn:hover:not(:disabled) {
    background-color: #4b5563;
}

.refresh-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.add-symbol-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.add-symbol-container .input-group {
    flex: 1;
    min-width: 150px;
}

.watchlist-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.watchlist-item {
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
    transition: all 0.2s;
    position: relative;
}

.watchlist-item.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.watchlist-item.loading {
    opacity: 0.7;
}

.watchlist-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.watchlist-symbol {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.1rem;
}

.remove-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 2px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.remove-btn:hover {
    background-color: #f3f4f6;
    color: #ef4444;
}

.watchlist-item-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.watchlist-detail {
    display: flex;
    flex-direction: column;
}

.watchlist-detail-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 2px;
}

.watchlist-detail-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1f2937;
}

.watchlist-detail-value.loading::after {
    content: "...";
    animation: ellipsis 1s infinite;
}

@keyframes ellipsis {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
}

.watchlist-item-error {
    padding: 8px;
    background-color: #fef2f2;
    color: #b91c1c;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-top: 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Search panel */
.search-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e1e5e9;
}

.input-group {
    flex: 1;
    min-width: 250px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.input-group input {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: #fff;
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button {
    align-self: flex-end;
    padding: 14px 28px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

button:hover:not(:disabled) {
    background-color: #1d4ed8;
}

button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e1e5e9;
    margin-bottom: 30px;
}

.spinner {
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Error message */
.error {
    padding: 16px 20px;
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Results section */
.results-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 25px;
    border: 1px solid #e1e5e9;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.result-card {
    background: #fafafa;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eaeaea;
}

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

.label {
    font-weight: 500;
    color: #4b5563;
    font-size: 0.95rem;
}

.value {
    font-weight: 500;
    color: #1f2937;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
    font-size: 0.95rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge.bullish {
    background-color: #dcfce7;
    color: #166534;
}

.badge.bearish {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-neutral {
    background-color: #e5e7eb;
    color: #4b5563;
}

.badge-unknown {
    background-color: #e5e7eb;
    color: #4b5563;
}

.badge.positive {
    background-color: #dcfce7;
    color: #166534;
}

.badge.negative {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-panel {
        flex-direction: column;
        padding: 20px;
    }
    
    button {
        align-self: stretch;
        min-width: auto;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .result-item {
        padding: 10px 0;
    }
    
    .watchlist-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .watchlist-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .search-panel {
        padding: 15px;
    }
    
    .result-card {
        padding: 12px;
    }
}