/* TuesdAI Topic Selection UI
   Uses iwilly-professional theme tokens */

:root {
    --bg-primary: #f5f0e8;
    --bg-secondary: #e8e0d4;
    --bg-card: #ffffff;
    --text-primary: #2a2a2a;
    --text-secondary: #5a5a5a;
    --accent: #630000;
    --accent-hover: #8a1a1a;
    --accent-rgb: 99, 0, 0;
    --border: rgba(99, 0, 0, 0.2);
}

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

body {
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

header {
    background: var(--bg-secondary);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Topic cards */
.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    border-left: 3px solid transparent;
}

.topic-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.topic-card.selected {
    border-left-color: var(--accent);
    box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.15);
}

.topic-card h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.topic-card .pitch {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.topic-card .score-bar {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.topic-card .score-bar span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.topic-card .overlap {
    color: #b06060;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Selection panel */
#selection-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

#selection-panel h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--accent);
    margin-bottom: 1rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    margin-bottom: 1rem;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
}

button {
    background: var(--accent);
    color: #ffffff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: var(--accent-hover);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status messages */
#status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

#status.success {
    background: rgba(90, 154, 106, 0.1);
    color: #3a7a4a;
    border: 1px solid rgba(90, 154, 106, 0.3);
}

#status.error {
    background: rgba(176, 96, 96, 0.1);
    color: #903030;
    border: 1px solid rgba(176, 96, 96, 0.3);
}

/* Discovered sources */
#discovered-sources {
    margin-top: 2rem;
}

#discovered-sources h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.muted {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.source-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.source-item .source-info {
    flex: 1;
}

.source-item .source-name {
    font-weight: 600;
}

.source-item .source-url {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Loading */
#loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}
