* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.subtitle {
    color: #888;
    font-size: 1.05rem;
}

/* Search */
.search-section {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto 40px;
}

#company-input {
    flex: 1;
    padding: 14px 18px;
    background: #1a1a2e;
    border: 1px solid #2a2a40;
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#company-input:focus {
    border-color: #60a5fa;
}

#company-input::placeholder {
    color: #555;
}

#search-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

#search-btn:hover {
    opacity: 0.9;
}

#search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #2a2a40;
    border-top-color: #60a5fa;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    color: #aaa;
    margin-bottom: 4px;
}

.loading-detail {
    font-size: 0.85rem;
    color: #666 !important;
}

/* Error */
.error-banner {
    background: #2d1b1b;
    border: 1px solid #5c2b2b;
    border-radius: 10px;
    padding: 16px 20px;
    color: #f87171;
    text-align: center;
    margin-bottom: 24px;
}

/* Results */
.results-header {
    margin-bottom: 28px;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.results-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-badge {
    padding: 4px 12px;
    background: #1a1a2e;
    border: 1px solid #2a2a40;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #aaa;
}

/* Sentiment badges */
.sentiment-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.sentiment-positive { background: #1a2e1a; color: #4ade80; border: 1px solid #2e4a2e; }
.sentiment-negative { background: #2e1a1a; color: #f87171; border: 1px solid #4a2e2e; }
.sentiment-mixed { background: #2e2a1a; color: #fbbf24; border: 1px solid #4a3e2e; }
.sentiment-neutral { background: #1a1a2e; color: #aaa; border: 1px solid #2a2a40; }

/* Topic cards */
.topics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.topic-card {
    background: #141425;
    border: 1px solid #2a2a40;
    border-radius: 14px;
    padding: 24px;
    transition: border-color 0.2s;
}

.topic-card:hover {
    border-color: #3a3a55;
}

.topic-header {
    margin-bottom: 14px;
}

.topic-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #f0f0f0;
}

.topic-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.heat-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.tweet-count {
    font-size: 0.8rem;
    color: #888;
}

.topic-summary {
    color: #bbb;
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* Quotes */
.quotes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quote {
    border-left: 3px solid #3a3a55;
    padding: 10px 14px;
    background: #0f0f1a;
    border-radius: 0 8px 8px 0;
}

.quote-text {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 6px;
}

.quote-meta {
    color: #666;
    font-size: 0.8rem;
}

.quote-author {
    color: #60a5fa;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 24px 14px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .search-section {
        flex-direction: column;
    }

    #search-btn {
        width: 100%;
    }

    .topic-card {
        padding: 18px;
    }
}
