.weights-container {
    padding-top: 1.5rem;
    padding-bottom: 40px;
}

.weights-container h1 {
    margin-bottom: 24px;
    color: var(--text-color);
}

.weights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.weights-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
}

.weights-section h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

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

.section-header h2 {
    margin-bottom: 0;
}

.secondary-button {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
}

.secondary-button:hover {
    background: var(--bg-color);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.cloud-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.legend-title {
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 700;
}

.legend-chip {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    line-height: 1;
    padding: 6px 10px;
    white-space: nowrap;
}

.legend-note {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.wordcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    min-height: 120px;
    margin-bottom: 20px;
}

.cloud-word {
    padding: 4px 10px;
    border-radius: 6px;
    cursor: default;
    transition: transform 0.15s;
    white-space: nowrap;
}

.cloud-word:hover {
    transform: scale(1.1);
}

.word-deletable {
    position: relative;
    transition: opacity 0.2s;
}

.word-delete {
    display: none;
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s;
}

.word-deletable:hover .word-delete {
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-delete:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.cloud-word.base-important {
    background: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
    font-weight: 700;
}

.cloud-word.base-semiimportant {
    background: rgba(139, 92, 246, 0.16);
    color: #6d28d9;
    font-weight: 600;
}

.cloud-word.base-excluded {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.cloud-word.learn-positive {
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.45);
}

.cloud-word.learn-negative {
    box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.45);
}

.cloud-word.learn-neutral {
    box-shadow: inset 0 0 0 1px rgba(156, 163, 175, 0.25);
}

.legend-chip.base-important {
    background: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
    font-weight: 700;
}

.legend-chip.base-semiimportant {
    background: rgba(139, 92, 246, 0.16);
    color: #6d28d9;
    font-weight: 600;
}

.legend-chip.base-excluded {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.legend-chip.learn-positive {
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.45);
}

.legend-chip.learn-negative {
    box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.45);
}

.legend-chip.learn-neutral {
    box-shadow: inset 0 0 0 1px rgba(156, 163, 175, 0.25);
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    width: 100%;
}

.weights-table-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.weights-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.weights-table th,
.weights-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.weights-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-color);
    position: sticky;
    top: 0;
}

.weights-table tbody tr:hover {
    background: var(--bg-secondary);
}

.weights-table .keyword-name,
.weights-table .subreddit-name {
    font-weight: 500;
    color: var(--text-color);
}

.weights-table .adjustment,
.weights-table .multiplier,
.weights-table .base-weight {
    font-family: monospace;
    font-weight: 600;
}

.weights-table .adjustment.positive,
.weights-table .multiplier.positive {
    color: #22c55e;
}

.weights-table .adjustment.negative,
.weights-table .multiplier.negative {
    color: #ef4444;
}

.weights-table .base-weight.base-important {
    color: #1d4ed8;
}

.weights-table .base-weight.base-excluded {
    color: #b45309;
}

.keyword-band {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 8px;
    white-space: nowrap;
}

.band-important {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.band-semiimportant {
    background: rgba(139, 92, 246, 0.14);
    color: #6d28d9;
}

.band-excluded {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.weights-table .count {
    text-align: center;
}

.weights-table .count.excellent {
    color: #22c55e;
}

.weights-table .count.acceptable {
    color: var(--accent-color);
}

.weights-table .count.bad {
    color: #ef4444;
}

.stats-summary {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
}

.stats-summary h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-card .stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-card.excellent .stat-value {
    color: #22c55e;
}

.stat-card.acceptable .stat-value {
    color: var(--accent-color);
}

.stat-card.bad .stat-value {
    color: #ef4444;
}

@media (max-width: 600px) {
    .weights-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }
    
    .weights-section {
        padding: 16px;
    }
    
    .wordcloud {
        padding: 12px;
    }
    
    .weights-table-container {
        max-height: 200px;
    }
}
