/**
 * Behind Charter Schools - Main Stylesheet
 * Townhall theme: Warm civic colors, minimalistic, eye-friendly
 */

:root {
    --navy: #1B2A4A;
    --navy-light: #2C4A7C;
    --amber: #D4A853;
    --amber-dark: #C49843;
    --cream: #FAF7F0;
    --text-dark: #2D3436;
    --text-muted: #666;
    --border: #ddd;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--cream);
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header h1 a {
    color: var(--cream);
    text-decoration: none;
}

.header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header nav a {
    color: var(--cream);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.header nav a:hover {
    color: var(--amber);
}

.notification-bell {
    position: relative;
    font-size: 1.25rem;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background: var(--amber);
    color: var(--navy);
}

.btn-primary:hover {
    background: var(--amber-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--navy);
    color: var(--cream);
}

.btn-secondary:hover {
    background: var(--navy-light);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Thread Card */
.thread-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s;
}

.thread-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.thread-card.pinned {
    border-left: 4px solid var(--amber);
}

.thread-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.thread-meta {
    flex: 1;
}

.thread-author {
    font-weight: 600;
    color: var(--navy);
}

.thread-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.thread-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.thread-title a {
    color: var(--navy);
    text-decoration: none;
}

.thread-title a:hover {
    color: var(--amber-dark);
}

.thread-body {
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.thread-footer {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: var(--cream);
    color: var(--navy);
}

.reaction-btn.active {
    color: var(--navy);
    font-weight: 600;
}

.reaction-btn.like.active {
    color: var(--success);
}

.reaction-btn.dislike.active {
    color: var(--error);
}

.reaction-btn.factcheck.active {
    color: var(--info);
}

/* Comment */
.comment {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--border);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: var(--navy);
}

.comment-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-body {
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.comment-footer {
    display: flex;
    gap: 1rem;
}

/* Fact-Check Bubble */
.fact-check-bubble {
    background: #EEF2F7;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0 1rem 2rem;
    border-left: 4px solid var(--info);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.fact-check-bubble.verified {
    border-left-color: var(--success);
}

.fact-check-bubble.disputed {
    border-left-color: var(--error);
}

.fact-check-bubble.partially-true {
    border-left-color: var(--warning);
}

.fact-check-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.curio-logo {
    width: 24px;
    height: 24px;
}

.fact-check-header h4 {
    color: var(--navy);
    font-size: 1rem;
}

.verdict-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.verdict-badge.verified {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.verdict-badge.disputed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.verdict-badge.partially-true {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.verdict-badge.unverifiable {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.claim {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #ddd;
}

.claim-text {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.claim-verdict {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.claim-sources {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.claim-sources a {
    color: var(--info);
    text-decoration: none;
}

.claim-sources a:hover {
    text-decoration: underline;
}

.fact-check-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.fact-check-footer a {
    color: #4A90E2;
    text-decoration: none;
    font-weight: 600;
}

.fact-check-footer a:hover {
    text-decoration: underline;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

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

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--amber);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 3px solid;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error);
    color: var(--error);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--info);
    color: var(--info);
}

/* Footer */
.footer {
    background: var(--navy);
    color: var(--cream);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer a {
    color: var(--amber);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .thread-footer {
        flex-wrap: wrap;
    }
    
    .fact-check-bubble {
        margin-left: 0;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
