/* Fallacy Checker — Styles */

:root {
    --fc-primary: #2e4057;
    --fc-accent: #4a90d9;
    --fc-accent-dark: #3572b0;
    --fc-success: #2e7d32;
    --fc-warning: #f9a825;
    --fc-danger: #c62828;
    --fc-uncertain: #7b61a6;
    --fc-bg: #f8f9fa;
    --fc-card: #ffffff;
    --fc-border: #dde1e6;
    --fc-text: #2e3440;
    --fc-text-light: #636e7b;
    --fc-radius: 8px;
    --fc-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --fc-shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --fc-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --fc-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

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

body {
    font-family: var(--fc-font);
    background: var(--fc-bg);
    color: var(--fc-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.fc-header {
    background: var(--fc-primary);
    color: #fff;
    padding: 2em 1.5em;
    text-align: center;
}
.fc-header h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 0.3em;
    letter-spacing: -0.02em;
}
.fc-header .fc-tagline {
    font-size: 1.05em;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ===== MAIN CONTAINER ===== */
.fc-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2em 1.5em 4em;
}

/* ===== INPUT SECTION ===== */
.fc-input-section {
    background: var(--fc-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    padding: 1.5em;
    margin-bottom: 1.5em;
    box-shadow: var(--fc-shadow);
}

.fc-controls {
    display: flex;
    gap: 1em;
    align-items: center;
    margin-bottom: 1em;
    flex-wrap: wrap;
}

.fc-mode-toggle {
    display: flex;
    border: 1px solid var(--fc-border);
    border-radius: 6px;
    overflow: hidden;
}
.fc-mode-toggle button {
    padding: 0.5em 1em;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--fc-text-light);
    transition: all 0.2s;
}
.fc-mode-toggle button.active {
    background: var(--fc-accent);
    color: #fff;
}
.fc-mode-toggle button:hover:not(.active) {
    background: #f0f4f8;
}

.fc-engine-select {
    display: flex;
    gap: 0.75em;
    align-items: center;
    margin-left: auto;
}
.fc-engine-select label {
    display: flex;
    align-items: center;
    gap: 0.35em;
    font-size: 0.85em;
    color: var(--fc-text-light);
    cursor: pointer;
}
.fc-engine-select input[type="checkbox"] {
    accent-color: var(--fc-accent);
}

.fc-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1em;
    border: 1px solid var(--fc-border);
    border-radius: 6px;
    font-family: var(--fc-font);
    font-size: 0.95em;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.2s;
    color: var(--fc-text);
}
.fc-textarea:focus {
    outline: none;
    border-color: var(--fc-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}
.fc-textarea::placeholder {
    color: #aab3be;
}

.fc-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1em;
}

.fc-char-count {
    font-size: 0.8em;
    color: var(--fc-text-light);
}

.fc-analyze-btn {
    padding: 0.7em 2em;
    background: var(--fc-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.fc-analyze-btn:hover {
    background: var(--fc-accent-dark);
    box-shadow: var(--fc-shadow);
}
.fc-analyze-btn:disabled {
    background: #b0bec5;
    cursor: not-allowed;
}

/* ===== LOADING ===== */
.fc-loading {
    display: none;
    text-align: center;
    padding: 3em 1em;
    background: var(--fc-card);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    margin-bottom: 1.5em;
}
.fc-loading.active { display: block; }

.fc-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--fc-border);
    border-top-color: var(--fc-accent);
    border-radius: 50%;
    animation: fc-spin 0.8s linear infinite;
}
@keyframes fc-spin {
    to { transform: rotate(360deg); }
}
.fc-loading p {
    margin-top: 1em;
    color: var(--fc-text-light);
    font-size: 0.95em;
}

/* ===== RESULTS ===== */
.fc-results {
    display: none;
}
.fc-results.active { display: block; }

/* Engine tabs */
.fc-engine-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}
.fc-engine-tab {
    padding: 0.75em 1.5em;
    border: 1px solid var(--fc-border);
    border-bottom: none;
    background: #f0f4f8;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--fc-text-light);
    border-radius: var(--fc-radius) var(--fc-radius) 0 0;
    transition: all 0.2s;
    position: relative;
    bottom: -1px;
}
.fc-engine-tab.active {
    background: var(--fc-card);
    color: var(--fc-text);
    border-bottom-color: var(--fc-card);
    font-weight: 600;
}
.fc-engine-tab .fc-tab-model {
    font-size: 0.8em;
    color: var(--fc-text-light);
    margin-left: 0.5em;
}
.fc-engine-tab .fc-tab-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4em;
}
.fc-tab-status.ok { background: var(--fc-success); }
.fc-tab-status.error { background: var(--fc-danger); }

.fc-engine-panel {
    display: none;
    background: var(--fc-card);
    border: 1px solid var(--fc-border);
    border-radius: 0 var(--fc-radius) var(--fc-radius) var(--fc-radius);
    padding: 1.5em;
    box-shadow: var(--fc-shadow);
}
.fc-engine-panel.active { display: block; }

/* Summary card */
.fc-summary {
    background: #f0f4f8;
    border-radius: 6px;
    padding: 1.25em;
    margin-bottom: 1.5em;
}
.fc-summary h3 {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fc-text-light);
    margin-bottom: 0.5em;
}
.fc-summary p {
    font-size: 0.95em;
    line-height: 1.6;
}

.fc-quality-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: 0.5em;
}
.fc-quality-strong { background: #e8f5e9; color: var(--fc-success); }
.fc-quality-moderate { background: #fff8e1; color: #f57f17; }
.fc-quality-weak { background: #fce4ec; color: var(--fc-danger); }

/* Fallacy cards */
.fc-fallacy-list {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.fc-fallacy-card {
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.fc-fallacy-card:hover {
    box-shadow: var(--fc-shadow);
}

.fc-fallacy-header {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 1em 1.25em;
    cursor: pointer;
    background: #fafbfc;
    border-bottom: 1px solid transparent;
    user-select: none;
}
.fc-fallacy-header.expanded {
    border-bottom-color: var(--fc-border);
}

.fc-severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.fc-severity-critical { background: var(--fc-danger); }
.fc-severity-moderate { background: var(--fc-warning); }
.fc-severity-minor { background: #90a4ae; }

.fc-fallacy-name {
    font-weight: 600;
    font-size: 1em;
    flex: 1;
}

.fc-fallacy-badges {
    display: flex;
    gap: 0.4em;
    flex-shrink: 0;
}
.fc-badge {
    padding: 0.15em 0.5em;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.fc-badge-category {
    background: #e3f2fd;
    color: #1565c0;
}
.fc-badge-fallacious {
    background: #fce4ec;
    color: var(--fc-danger);
}
.fc-badge-legitimate {
    background: #e8f5e9;
    color: var(--fc-success);
}
.fc-badge-uncertain {
    background: #ede7f6;
    color: var(--fc-uncertain);
}
.fc-badge-confidence {
    background: #f5f5f5;
    color: #616161;
}

.fc-expand-icon {
    font-size: 0.8em;
    color: var(--fc-text-light);
    transition: transform 0.2s;
}
.fc-fallacy-header.expanded .fc-expand-icon {
    transform: rotate(90deg);
}

.fc-fallacy-body {
    display: none;
    padding: 1.25em;
}
.fc-fallacy-body.expanded { display: block; }

.fc-detail-section {
    margin-bottom: 1.25em;
}
.fc-detail-section:last-child { margin-bottom: 0; }

.fc-detail-label {
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fc-text-light);
    margin-bottom: 0.3em;
}

.fc-detail-content {
    font-size: 0.92em;
    line-height: 1.6;
}

.fc-passage-quote {
    border-left: 3px solid var(--fc-accent);
    padding: 0.75em 1em;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: #455a64;
}

.fc-steelman-box {
    border-left: 3px solid var(--fc-success);
    padding: 0.75em 1em;
    background: #f1f8f2;
    border-radius: 0 4px 4px 0;
}

.fc-sound-box {
    border-left: 3px solid var(--fc-accent);
    padding: 0.75em 1em;
    background: #f0f7ff;
    border-radius: 0 4px 4px 0;
}

/* Strengthening suggestions (self-check mode) */
.fc-suggestions {
    background: #f1f8f2;
    border: 1px solid #c8e6c9;
    border-radius: var(--fc-radius);
    padding: 1.25em;
    margin-top: 1.5em;
}
.fc-suggestions h3 {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fc-success);
    margin-bottom: 0.75em;
}
.fc-suggestions ul {
    list-style: none;
    padding: 0;
}
.fc-suggestions li {
    padding: 0.4em 0;
    padding-left: 1.5em;
    position: relative;
    font-size: 0.92em;
    line-height: 1.5;
}
.fc-suggestions li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--fc-success);
    font-weight: 700;
}

/* Fallacy fallacy note */
.fc-fallacy-fallacy {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--fc-radius);
    padding: 1em 1.25em;
    margin-top: 1.5em;
    font-size: 0.9em;
}
.fc-fallacy-fallacy strong {
    color: #f57f17;
}

/* Error state */
.fc-engine-error {
    text-align: center;
    padding: 2em;
    color: var(--fc-danger);
}
.fc-engine-error p {
    margin-top: 0.5em;
    font-size: 0.9em;
}

/* No fallacies */
.fc-no-fallacies {
    text-align: center;
    padding: 2em 1em;
    color: var(--fc-success);
}
.fc-no-fallacies .fc-check-icon {
    font-size: 2.5em;
    margin-bottom: 0.3em;
}

/* ===== FOOTER ===== */
.fc-footer {
    text-align: center;
    padding: 2em 1em;
    font-size: 0.8em;
    color: var(--fc-text-light);
}
.fc-footer a {
    color: var(--fc-accent);
    text-decoration: none;
}
.fc-footer a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .fc-header h1 { font-size: 1.5em; }
    .fc-controls { flex-direction: column; align-items: stretch; }
    .fc-engine-select { margin-left: 0; }
    .fc-input-footer { flex-direction: column; gap: 0.75em; }
    .fc-analyze-btn { width: 100%; }
    .fc-engine-tabs { flex-direction: column; }
    .fc-engine-tab { border-radius: var(--fc-radius); border-bottom: 1px solid var(--fc-border); }
    .fc-engine-panel { border-radius: var(--fc-radius); }
    .fc-fallacy-badges { flex-wrap: wrap; }
}
