/* ============================================
   All Time Draft — Shared Components
   Reusable classes extracted from templates
   ============================================ */

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 18px;
}

.card h2,
.card h3 {
    margin-top: 0;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-weight: bold;
    background: var(--accent);
    color: var(--bg-body);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    line-height: 1.2;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-body);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-input);
}

.btn-splash {
    background: var(--accent);
    color: var(--bg-body);
}

.btn-pass {
    background: #334155;
    color: var(--text-primary);
}

/* --- Forms --- */
.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #e5e7eb;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.12);
}

.help-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 6px;
}

ul.errorlist {
    color: #fca5a5;
    margin: 6px 0 0 0;
    padding-left: 18px;
}

/* --- Auth Layout --- */
.auth-wrap {
    max-width: 520px;
    margin: 0 auto;
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

/* --- Page Width Constraint --- */
.page-wrap-local {
    max-width: 1150px;
    margin: 0 auto;
}

/* --- Grid Layouts --- */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* --- Stat Cards --- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 20px;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.stat-box {
    background: var(--bg-input);
    border: 1px solid #243041;
    border-radius: var(--radius-lg);
    padding: 10px;
    text-align: center;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 4px;
}

/* --- Pills & Badges --- */
.pill {
    display: inline-block;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    border: 1px solid #2f394d;
    color: var(--text-subtle);
    font-size: 0.82rem;
}

.badge-pill {
    display: inline-block;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.mode-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    border: 1px solid var(--border-accent);
    color: var(--text-subtle);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* --- Pick Rows --- */
.pick-row {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 8px;
}

/* --- Notices --- */
.notice-success,
.notice-error {
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    margin-bottom: 16px;
}

.notice-success {
    background: var(--accent-dark);
    border: 1px solid var(--accent-border);
}

.notice-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
}

/* --- Comments --- */
.comment-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
}

.comment-meta {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.comment-meta a {
    color: #d1fae5;
    text-decoration: none;
}

.comment-meta a:hover {
    text-decoration: underline;
}

.comment-form textarea,
.flag-form textarea,
.flag-form select {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-primary);
    margin-bottom: 10px;
    box-sizing: border-box;
    font-size: inherit;
}

.comment-form textarea {
    min-height: 100px;
}

.flag-form textarea {
    min-height: 60px;
}

.flag-form select {
    min-height: 46px;
}

.flag-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #fca5a5;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.flag-button:hover {
    color: #fecaca;
}

.flag-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* --- Actions --- */
.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.action-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.action-title {
    font-weight: bold;
    margin-bottom: 6px;
}

/* --- Row Items --- */
.row-item {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.row-item:last-child {
    border-bottom: none;
}

.item-title {
    font-weight: bold;
    margin-bottom: 6px;
}

.item-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- Section Titles --- */
.section-title {
    margin-top: 0;
    margin-bottom: 12px;
}

/* --- Text Utilities --- */
.muted {
    color: var(--text-muted);
}

.meta {
    color: var(--text-muted);
    line-height: 1.6;
}

.meta a {
    color: #d1fae5;
    text-decoration: none;
}

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

.empty {
    color: var(--text-muted);
}

.subtle {
    color: var(--text-muted);
}

/* --- Pagination --- */
.pagination {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
}

.pagination .current {
    background: var(--accent);
    color: var(--bg-body);
    font-weight: bold;
}

/* --- Hero Cards --- */
.hero-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(34, 197, 94, 0.20);
    border-radius: var(--radius-2xl);
    padding: 20px;
    margin-bottom: 18px;
}

.creator-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), rgba(255, 255, 255, 0.03));
}

/* --- Misc --- */
.highlight {
    border: 2px solid var(--accent);
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.follow-form {
    margin-top: 10px;
}

.reported-label {
    display: inline-block;
    margin-top: 8px;
    color: #fca5a5;
    font-size: 0.85rem;
}

/* --- Share Bar --- */
.share-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.share-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.share-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.share-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.share-icon-btn,
.share-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

.share-copy-btn {
    background: var(--accent);
    color: var(--bg-body);
    border-color: var(--accent);
    padding: 0 14px;
    font-size: 0.92rem;
}

.share-icon-btn:hover,
.share-copy-btn:hover {
    opacity: 0.92;
}

.share-url-wrap {
    margin-top: 10px;
}

.share-url-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.share-status {
    color: #86efac;
    font-size: 0.88rem;
    margin-top: 8px;
    min-height: 18px;
}

/* --- Filters Bar (used across top_drafts, trending, player_list, debate_directory) --- */
.filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.filters label { display: block; font-weight: bold; margin-bottom: 6px; color: #e5e7eb; }

.filters input,
.filters select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 11px 12px;
    box-sizing: border-box;
    font-size: inherit;
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* --- Player Cards --- */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 18px;
}

.player-name { font-size: 1.08rem; font-weight: bold; margin-bottom: 8px; }
.stat-line { line-height: 1.6; color: var(--text-secondary); font-size: 0.95rem; }

/* --- Draft Cards --- */
.draft-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.draft-title { font-size: 1.1rem; font-weight: bold; margin-bottom: 10px; }

/* --- Status Pills --- */
.status-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    padding: 2px 9px;
    letter-spacing: 0.03em;
    margin-left: 8px;
    vertical-align: middle;
}

.status-draft     { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }
.status-published { background: rgba(34,197,94,0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.status-archived  { background: rgba(239,68,68,0.10);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

/* --- Challenge Strip --- */
.challenge-strip {
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 0.88rem;
}

.challenge-strip-title { font-weight: 700; color: #fbbf24; margin-bottom: 6px; }

.challenge-item {
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(251,191,36,0.12);
}

.challenge-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

/* --- Debate Matchup --- */
.matchup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.entry-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 8px; }
.entry-meta { color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.pick-list { margin-bottom: 16px; }

.splash-pass-box { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.splash-pass-title { font-size: 1rem; font-weight: bold; margin-bottom: 8px; }
.vote-form { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Profile Layout --- */
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.meta-row { margin-bottom: 10px; color: var(--text-secondary); }
.label { color: var(--text-muted); font-weight: bold; }

.sub-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 10px;
}

.sub-meta { color: var(--text-muted); font-size: 0.95rem; margin-top: 6px; }
.badge-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.quick-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* --- Card Accent Variants --- */
.card--indigo {
    background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(255,255,255,0.02));
    border-color: rgba(99,102,241,0.35);
}

.card--amber {
    border-color: rgba(251,191,36,0.35);
    background: rgba(251,191,36,0.04);
}

.card--green {
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
}

/* --- Badge Count (notification/challenge counter) --- */
.badge-count {
    background: #f59e0b;
    color: #000;
    border-radius: var(--radius-pill);
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 4px;
    display: inline-block;
}

/* --- Indigo Button Variant --- */
.btn-indigo {
    background: rgba(99,102,241,0.85);
    color: #fff;
}

.btn-indigo:hover { opacity: 0.9; }

/* --- Debate Title row --- */
.debate-title { font-size: 1rem; font-weight: bold; margin-bottom: 6px; }

/* --- Rankings --- */
.rank { font-weight: bold; font-size: 1.1rem; margin-bottom: 4px; }

/* --- Utility --- */
.mt-0 { margin-top: 0 !important; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.flex-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pick-meta { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 6px; }

/* --- Notification Card --- */
.notification-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.notification-card.unread { border-color: var(--accent-border); background: rgba(34,197,94,0.04); }

/* --- Hero --- */
.hero {
    background: linear-gradient(135deg, #141824, #1b2233);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 20px;
}

.hero h1 { margin-top: 0; margin-bottom: 14px; font-size: 2rem; }
.hero p { color: var(--text-secondary); line-height: 1.6; max-width: 760px; margin: 0 auto 24px auto; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
