/* ============================================
   Free-Realms — Design System
   CSS Variables + Utility Classes
   ============================================ */

/* --- Theme Variables --- */
:root {
    /* Backgrounds */
    --bg-body: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-elevated: #222;
    --bg-input: #111;
    --bg-hover: #222;
    --bg-surface: #111;

    /* Borders */
    --border-primary: #2a2a2a;
    --border-secondary: #333;
    --border-subtle: #222;
    --border-focus: #4a9eff;

    /* Text */
    --text-primary: #fff;
    --text-secondary: #ccc;
    --text-muted: #888;
    --text-faint: #666;
    --text-dimmed: #555;
    --text-placeholder: #666;

    /* Accent Colors */
    --accent-blue: #4a9eff;
    --accent-blue-hover: #3a8eef;
    --accent-purple: #bb6bff;
    --accent-green: #6bff6b;
    --accent-yellow: #ffdd6b;
    --accent-red: #ff6b6b;
    --accent-orange: #ffaa6b;

    /* Semantic Backgrounds */
    --bg-success: #1f3d1f;
    --bg-error: #3d1f1f;
    --bg-warning: #3d3d1f;
    --bg-info: #2a3d5c;
    --bg-purple: #3d2a5c;

    /* Semantic Text */
    --text-success: #6bff6b;
    --text-error: #ff6b6b;
    --text-warning: #ffdd6b;
    --text-info: #4a9eff;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.5);

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;
}

/* --- Light Theme Variables --- */
body.light-theme {
    --bg-body: #f5f5f5;
    --bg-card: #fff;
    --bg-elevated: #f0f0f0;
    --bg-input: #f9f9f9;
    --bg-hover: #f0f0f0;
    --bg-surface: #f5f5f5;

    --border-primary: #ddd;
    --border-secondary: #ccc;
    --border-subtle: #eee;
    --border-focus: #4a9eff;

    --text-primary: #111;
    --text-secondary: #333;
    --text-muted: #666;
    --text-faint: #888;
    --text-dimmed: #999;
    --text-placeholder: #999;

    --accent-blue: #2a7de1;
    --accent-blue-hover: #1a6dd1;
    --accent-purple: #7c3aed;
    --accent-green: #2e7d32;
    --accent-yellow: #b8860b;
    --accent-red: #c62828;
    --accent-orange: #e65100;

    --bg-success: #e8f5e9;
    --bg-error: #fdecea;
    --bg-warning: #fff8e1;
    --bg-info: #e3f2fd;
    --bg-purple: #f3e5f5;

    --text-success: #2e7d32;
    --text-error: #c62828;
    --text-warning: #f57f17;
    --text-info: #1565c0;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
}

/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1, h2, h3 { color: var(--text-primary); margin-bottom: 1.5rem; }

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    margin-top: 4rem;
}

/* --- Card --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* --- Forms --- */
.form-group { margin-bottom: 1.2rem; }

label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="datetime-local"] {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
}

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

textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    width: 100%;
    transition: background 0.2s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: var(--accent-blue-hover); }

.btn-secondary { background: var(--bg-elevated); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--border-secondary); }

.btn-danger { background: var(--bg-error); color: var(--text-error); }
.btn-danger:hover { background: #5c2a2a; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; width: auto; }
.btn-md { padding: 0.5rem 1rem; font-size: 0.9rem; width: auto; }
.btn-auto { width: auto; }

/* --- Navigation --- */
nav {
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-card);
}
nav .brand { font-weight: 600; color: var(--text-primary); text-decoration: none; }
.nav-links { display: flex; gap: 1.2rem; align-items: center; }
.nav-links .link { color: var(--text-muted); }
.nav-links .link:hover { color: var(--text-primary); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }

/* --- Flash Messages --- */
.flash {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
    position: relative;
}
.flash.error { background: var(--bg-error); color: var(--text-error); border: 1px solid #5c2a2a; }
.flash.success { background: var(--bg-success); color: var(--text-success); border: 1px solid #2a5c2a; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Links --- */
.link { color: var(--accent-blue); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}
.tab {
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-size: 0.95rem;
    transition: color 0.2s, border-color 0.2s;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--accent-blue); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Code Display --- */
.code-display {
    background: var(--bg-input);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    font-family: monospace;
    font-size: 0.95rem;
    word-break: break-all;
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

/* --- Badges & Tags --- */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-player { background: var(--bg-success); color: var(--text-success); }
.badge-dm { background: var(--bg-purple); color: var(--accent-purple); }
.badge-admin { background: var(--bg-info); color: var(--text-info); }
.badge-pro { background: var(--bg-success); color: var(--text-success); }

.status-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}
.status-active { background: var(--bg-success); color: var(--text-success); }
.status-paused { background: var(--bg-warning); color: var(--text-warning); }
.status-completed { background: var(--bg-info); color: var(--text-info); }
.status-archived { background: var(--bg-elevated); color: var(--text-muted); }

/* --- User Avatar --- */
.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: var(--bg-purple);
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-md { width: 36px; height: 36px; font-size: 0.85rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 1.1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-img { border-radius: var(--radius-full); object-fit: cover; border: 2px solid var(--border-secondary); }

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    animation: slideUp 0.3s ease;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Modals --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1500;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    overflow-y: auto;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 2rem;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Bottom Chat Bar --- */
#bottom-chat {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-secondary);
    z-index: 900;
    overflow: hidden;
}
.chat-bar-tab {
    padding: 0.3rem 0.8rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    color: var(--text-muted);
}
.chat-bar-tab.active, .chat-bar-tab[style*="border-bottom-color: #4a9eff"] {
    color: var(--text-primary);
    border-bottom-color: var(--accent-blue);
}
#chat-bar-input {
    flex: 1;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
}
#chat-bar-toggle {
    position: fixed;
    bottom: 0;
    right: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 0.4rem 1rem;
    color: var(--accent-blue);
    cursor: pointer;
    z-index: 901;
    font-size: 0.85rem;
}

/* --- Notification Panel --- */
#notif-panel {
    display: none;
    position: fixed;
    top: 60px;
    right: 1rem;
    width: 320px;
    max-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    z-index: 999;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* --- Context Menu --- */
#user-context-menu {
    display: none;
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    z-index: 2000;
    padding: 0.3rem 0;
    min-width: 150px;
    box-shadow: var(--shadow-md);
}
#user-context-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
}
#user-context-menu button:hover { background: var(--bg-hover); }

/* --- Feed / Posts --- */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    margin-bottom: 1rem;
}
.post-card:hover { transform: none; box-shadow: none; }
.post-author { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; }
.post-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); object-fit: cover; border: 2px solid var(--border-secondary); }
.post-avatar-placeholder {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-purple);
    color: var(--accent-purple);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700;
}
.post-body {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0.8rem;
}
.post-image { max-width: 100%; border-radius: var(--radius-md); margin-bottom: 0.8rem; cursor: pointer; }
.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.post-tag {
    background: var(--bg-input);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    color: var(--accent-blue);
    cursor: pointer;
}
.post-tag:hover { background: var(--bg-hover); }
.post-actions { display: flex; gap: 1rem; align-items: center; }
.post-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}
.post-action-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.post-action-btn.liked { color: var(--accent-red); }
.post-time { color: var(--text-dimmed); font-size: 0.75rem; margin-left: auto; }

/* --- Comments --- */
.comment-section { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--border-subtle); }
.comment-item { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.comment-avatar {
    width: 24px; height: 24px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; color: var(--text-muted);
}
.comment-body {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.7rem;
    flex: 1;
}
.comment-author { color: var(--accent-blue); font-size: 0.8rem; font-weight: 600; }
.comment-text { color: var(--text-secondary); font-size: 0.85rem; }
.comment-input { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.comment-input input {
    flex: 1;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* --- Compose Box --- */
.compose-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.compose-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.8rem;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
}
.compose-textarea:focus { border-color: var(--border-focus); outline: none; }
.compose-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.8rem; }
.char-count { font-size: 0.75rem; color: var(--text-dimmed); }

/* --- Follow Button --- */
.follow-btn {
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: background 0.2s;
}
.follow-btn-follow { background: var(--accent-blue); color: #fff; }
.follow-btn-follow:hover { background: var(--accent-blue-hover); }
.follow-btn-following { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-secondary); }
.follow-btn-following:hover { background: var(--bg-error); color: var(--text-error); }

/* --- Profile Stats --- */
.profile-stats { display: flex; gap: 1.5rem; margin: 0.5rem 0; }
.profile-stat { text-align: center; cursor: pointer; }
.profile-stat-num { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.profile-stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* --- Trending Posts (Dashboard) --- */
.trending-post { padding: 0.8rem 0; border-bottom: 1px solid var(--border-subtle); }
.trending-post:last-child { border-bottom: none; }
.trending-post-author { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.trending-post-avatar { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; }
.trending-post-avatar-ph {
    width: 28px; height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-purple);
    color: var(--accent-purple);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700;
}
.trending-post-body {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.trending-post-actions { display: flex; gap: 0.8rem; font-size: 0.8rem; align-items: center; }
.trending-action-btn {
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer; font-size: 0.8rem;
    display: flex; align-items: center; gap: 0.2rem;
    padding: 0.2rem 0.4rem; border-radius: var(--radius-sm);
}
.trending-action-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.trending-action-btn.liked { color: var(--accent-red); }
.trending-comment-section { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-subtle); }

/* --- Feed Tabs --- */
.feed-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-primary); }
.feed-tab {
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-size: 0.95rem;
    transition: color 0.2s, border-color 0.2s;
    background: none;
    border-top: none; border-left: none; border-right: none;
}
.feed-tab:hover { color: var(--text-secondary); }
.feed-tab.active { color: var(--text-primary); border-bottom-color: var(--accent-blue); }

/* --- Empty States --- */
.empty-feed { text-align: center; padding: 3rem 1rem; color: var(--text-faint); }
.empty-feed h3 { color: var(--text-muted); margin-bottom: 0.5rem; }

/* --- Accessibility --- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-blue);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 9999;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

*:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 1px;
}

/* --- Password Strength --- */
.pw-strength { height: 4px; border-radius: 2px; margin-top: 0.4rem; transition: width 0.3s ease, background 0.3s ease; }

/* --- Drag & Drop Upload --- */
.drop-zone {
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    color: var(--text-faint);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent-blue); background: rgba(74,158,255,0.05); }
.drop-zone.has-file { border-color: var(--accent-green); background: rgba(107,255,107,0.05); color: var(--accent-green); }

/* --- Mobile / Responsive --- */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
        padding-top: 0.8rem;
        align-items: flex-start;
    }
    .nav-links.open { display: flex; }
    .container { padding: 1rem; margin-top: 1rem; }
    nav { padding: 0.8rem 1rem; flex-wrap: wrap; }
    nav .brand { font-size: 0.9rem; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab { white-space: nowrap; padding: 0.6rem 0.8rem; font-size: 0.85rem; }
    .card { padding: 1.2rem; }
    .card:hover { transform: none; box-shadow: none; }
    h2 { font-size: 1.3rem; }
}

/* --- Utility Classes --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: 0.3rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 0.8rem; }
.gap-lg { gap: 1.2rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-primary { color: var(--text-primary); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.border-bottom { border-bottom: 1px solid var(--border-subtle); }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }

/* --- Loading Spinner --- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-secondary);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-faint);
    gap: 0.5rem;
}

/* Button loading state */
.btn.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}
.btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}
