:root {
    --primary-bg: #f0f2f5;
    --container-bg: #ffffff;
    --text-color: #1c1e21;
    --primary-color: #1877f2;
    --secondary-color: #42b72a;
    --danger-color: #fa3e3e;
    --warning-color: #f0ad4e;
    --border-color: #dddfe2;
    --shadow-light: rgba(0, 0, 0, 0.1);
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 1rem;
    background-color: var(--primary-bg);
    color: var(--text-color);
    display: flex;
    justify-content: center;
}
.container {
    background-color: var(--container-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-light), 0 8px 16px var(--shadow-light);
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}
h1, h2, h3 {
    color: var(--primary-color);
    text-align: center;
}
h3.section-header {
    color: #65676b;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.hidden { display: none !important; }

/* --- Input & Forms --- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-group input, .form-group textarea {
    width: 100%; padding: 0.75rem; border: 1px solid var(--border-color);
    border-radius: 6px; box-sizing: border-box; font-size: 1rem;
}
.form-group textarea { min-height: 80px; }
.input-group { display: flex; gap: 0.5rem; }
.input-group input { flex-grow: 1; }
.input-group button { width: auto; }


/* --- Buttons --- */
.btn {
    display: inline-block; width: 100%; padding: 0.85rem 1rem; border: none;
    border-radius: 6px; background-color: var(--primary-color); color: white;
    font-size: 1.1rem; font-weight: 600; cursor: pointer;
    transition: background-color 0.2s; text-align: center; box-sizing: border-box;
}
.btn p { margin: 0.2rem 0 0; font-size: 0.85rem; font-weight: 400; opacity: 0.9; }
.btn:hover { background-color: #166fe5; }
.btn-secondary { background-color: #e4e6eb; color: var(--text-color); }
.btn-secondary:hover { background-color: #d8dade; }
.btn-success { background-color: var(--secondary-color); }
.btn-success:hover { background-color: #3aa825; }
.btn-danger { background-color: var(--danger-color); }
.btn-danger:hover { background-color: #e03030; }
.btn-warning { background-color: var(--warning-color); color: white; }
.btn-warning:hover { background-color: #ec9b3b; }
.btn-sm { padding: 0.5rem 0.75rem; font-size: 0.9rem; font-weight: 600; width: auto; }
.btn-delete { background: none; border: none; color: var(--danger-color); cursor: pointer; font-size: 1.2rem; padding: 0.5rem; }

/* --- Dashboard & Status --- */
#dashboard-section { display: flex; flex-direction: column; gap: 0.75rem; }
#status-bar { text-align: center; padding: 1rem; background: #e7f3ff; border-radius: 6px; margin-bottom: 1rem; }
#progress-bar { width: 100%; margin-top: 0.5rem; }
#progress-text { font-weight: bold; }

/* --- App Section & Navigation --- */
#app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
#app-title { margin: 0; text-align: left; }
#back-to-dashboard-btn {
    font-size: 0.9rem; font-weight: 600; color: var(--primary-color);
    text-decoration: none; cursor: pointer; border: none; background: none;
}

/* --- Lists --- */
.list-item-base {
    display: flex; align-items: center; margin-bottom: 0.5rem;
    border: 1px solid var(--border-color); border-radius: 6px; background-color: #f7f8fa;
    transition: opacity 0.3s ease-out; padding: 0.5rem;
}
.list-item-base.fading-out { opacity: 0; }
.list-item-base label {
    display: flex; align-items: center; padding: 1rem;
    width: 100%; box-sizing: border-box; cursor: pointer;
}
.list-item-base input[type="checkbox"], .list-item-base input[type="radio"] { transform: scale(1.5); margin-right: 1rem; flex-shrink: 0; }
.idea-content { flex-grow: 1; padding: 0 0.5rem; }
.idea-title { font-weight: 600; }
.idea-summary { font-size: 0.9em; color: #65676b; }
.drag-handle { margin: 0 1rem; color: #65676b; font-size: 1.5rem; line-height: 1; cursor: grab; }
.list-item-base.sortable-ghost { opacity: 0.4; background: #c8ebfb; }

/* --- Tag Styles --- */
.tag { display: inline-block; background-color: #e4e6eb; color: var(--text-color); padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.8em; margin: 0.2rem; }
.tag-list { list-style: none; padding: 0; margin-top: 1rem; }
.tag-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem; border-bottom: 1px solid #eee; }
.tag-list li:last-child { border-bottom: none; }

/* --- Modal Styles --- */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-content { background: white; padding: 2rem; border-radius: 8px; width: 90%; max-width: 500px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-title { margin: 0; color: var(--primary-color);}
.modal-close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.tag-selection-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 6px; padding: 0.5rem; }
.tag-selection-list label { display: block; padding: 0.5rem; }
#csv-upload-feedback { margin-top: 1rem; font-weight: bold; }


/* --- Global Feedback --- */
#loading-spinner {
    border: 5px solid #f3f3f3; border-top: 5px solid var(--primary-color); border-radius: 50%;
    width: 50px; height: 50px; animation: spin 1s linear infinite; margin: 3rem auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.feedback-message { text-align: center; padding: 2rem; font-size: 1.2rem; }

/* --- Triage Mode Specific Styles --- */
#triage-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.triage-option {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    background-color: var(--container-bg);
}
.triage-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow-light);
    border-color: var(--primary-color);
}
.triage-option .idea-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.triage-vs {
    text-align: center;
    font-weight: bold;
    color: #888;
    font-size: 1.2rem;
}

/* --- Benchmark Mode Specific Styles --- */
#benchmark-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.benchmark-column {
    flex: 1;
    min-width: 0; /* Prevents flexbox overflow */
}
.benchmark-column h3 {
    color: #65676b;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.benchmark-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.benchmark-list-item:last-child {
    border-bottom: none;
}
.rank-indicator {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}
.benchmark-idea-title {
    flex-grow: 1;
    padding: 0 1rem;
}
.benchmark-item-actions {
    flex-wrap: nowrap;
    gap: 0.25rem;
}
.benchmark-item-actions .btn {
    min-width: 60px;
    max-width: 75px;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}
.rank-delta {
    font-weight: 600;
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}
.rank-delta.up { color: var(--secondary-color); }
.rank-delta.down { color: var(--danger-color); }
.rank-delta.same { color: #888; }

/* --- Media Queries for Responsiveness --- */
@media (min-width: 600px) {
    #triage-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
    }
    .triage-option {
        width: 48%;
    }
    .triage-vs {
        align-self: center;
    }
}

@media (min-width: 768px) {
    #benchmark-container {
        flex-direction: row;
    }
}
