/* ========================================
   TAGZ — CSS Design System
   ======================================== */

/* ═══ Splash / Pre-Home ═══ */
.splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary, #000);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash.hidden {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 580px;
    width: 100%;
    padding: 0 24px;
    animation: splashFadeIn 0.8s ease-out;
}

@keyframes splashFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.splash-logo {
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.splash-logo:hover {
    transform: scale(1.08) rotate(-5deg);
}

.splash-title {
    font-family: 'Inter', sans-serif;
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--text-primary, #e7e9ea);
    margin-bottom: 8px;
}

.splash-subtitle {
    font-size: 16px;
    color: var(--text-secondary, #71767b);
    margin-bottom: 40px;
    font-weight: 400;
}

.splash-search {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.splash-search-box {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary, #111);
    border: 1px solid var(--border-color, #2f3336);
    border-radius: 60px;
    padding: 14px 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.splash-search-box:focus-within {
    border-color: #1185fe;
    box-shadow: 0 0 0 3px rgba(17, 133, 254, 0.15);
}

.splash-search-box svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary, #71767b);
    flex-shrink: 0;
}

.splash-search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary, #e7e9ea);
    font-size: 17px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.splash-search-box input::placeholder {
    color: var(--text-tertiary, #536471);
}

.splash-kbd {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-elevated, #1e1e1e);
    border: 1px solid var(--border-color, #2f3336);
    color: var(--text-secondary, #71767b);
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    flex-shrink: 0;
}

.splash-network-toggle {
    display: flex;
    gap: 8px;
}

.splash-net-btn {
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color, #2f3336);
    background: transparent;
    color: var(--text-secondary, #71767b);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.splash-net-btn.active[data-network="bluesky"] {
    background: rgba(17, 133, 254, 0.15);
    border-color: #1185fe;
    color: #1185fe;
}

.splash-net-btn.active[data-network="mastodon"] {
    background: rgba(99, 100, 255, 0.15);
    border-color: #6364ff;
    color: #6364ff;
}

.splash-net-btn.active[data-network="lemmy"] {
    background: rgba(255, 99, 20, 0.15);
    border-color: #ff6314;
    color: #ff6314;
}

.splash-net-btn:hover:not(.active) {
    background: var(--bg-hover, #1a1a1a);
    color: var(--text-primary, #e7e9ea);
}

.splash-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.splash-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color, #2f3336);
    background: transparent;
    color: var(--text-secondary, #71767b);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.splash-chip:hover {
    background: var(--bg-hover, #1a1a1a);
    color: var(--text-primary, #e7e9ea);
    border-color: var(--text-tertiary, #536471);
}

/* Hide dashboard when splash is active */
.splash:not(.hidden) ~ .sidebar,
.splash:not(.hidden) ~ .main {
    opacity: 0;
    pointer-events: none;
}

:root {
    /* Colors - Dark Theme */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-card: #161616;
    --bg-hover: #1a1a1a;
    --bg-elevated: #1e1e1e;

    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --text-tertiary: #536471;

    --border-color: #2f3336;
    --border-light: #1e2023;

    --accent: #1d9bf0;
    --accent-hover: #1a8cd8;
    --accent-soft: rgba(29, 155, 240, 0.1);

    --danger: #f4212e;
    --success: #00ba7c;
    --warning: #ffd400;

    --sidebar-width: 72px;
    --sidebar-width-expanded: 220px;
    --topbar-height: 64px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(29, 155, 240, 0.15);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    --column-width: 380px;
    --column-min-width: 320px;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f9f9;
    --bg-tertiary: #eff3f4;
    --bg-card: #ffffff;
    --bg-hover: #f7f7f7;
    --bg-elevated: #ffffff;

    --text-primary: #0f1419;
    --text-secondary: #536471;
    --text-tertiary: #8899a6;

    --border-color: #eff3f4;
    --border-light: #e1e8ed;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

/* ========================================
   Reset & Base
   ======================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    flex-shrink: 0;
    z-index: 100;
    transition: width var(--transition-normal);
}

.sidebar:hover {
    width: var(--sidebar-width-expanded);
}

.sidebar:hover .nav-btn span {
    opacity: 1;
    width: auto;
    margin-left: 12px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    margin-bottom: 32px;
    overflow: hidden;
    white-space: nowrap;
}

.logo-tagz {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 12px;
    flex-shrink: 0;
    user-select: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-tagz:hover {
    transform: scale(1.2) rotate(-8deg);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 0 12px;
    flex: 1;
}

.sidebar-bottom {
    width: 100%;
    padding: 0 12px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    white-space: nowrap;
}

.nav-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.nav-btn span {
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all var(--transition-normal);
    margin-left: 0;
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ========================================
   Main Content
   ======================================== */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ========================================
   Top Bar
   ======================================== */

.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
}

.topbar-count {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    gap: 8px;
    transition: all var(--transition-fast);
    min-width: 240px;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    background: var(--bg-primary);
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

/* ========================================
   Buttons
   ======================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Columns Container
   ======================================== */

.columns-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.columns {
    display: flex;
    gap: 0;
    height: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0;
}

/* ========================================
   Column
   ======================================== */

.column {
    width: var(--column-width);
    min-width: var(--column-min-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-primary);
    animation: columnSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes columnSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    min-height: 52px;
    gap: 8px;
}

.column-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.column-accent {
    width: 4px;
    height: 28px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.column-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.column-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.column-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.column-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.column-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

/* Loading state */
.column-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
    color: var(--text-tertiary);
    z-index: 2;
    background: var(--bg-primary);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Column remove animation */
.column.removing {
    animation: columnSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes columnSlideOut {
    to {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
        width: 0;
        min-width: 0;
        padding: 0;
        border: none;
    }
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    gap: 16px;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: var(--radius-xl);
    color: var(--accent);
    margin-bottom: 8px;
}

.empty-icon svg {
    width: 40px;
    height: 40px;
}

.empty-state h2 {
    font-size: 24px;
    font-weight: 700;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 400px;
    line-height: 1.5;
}

.quick-add {
    margin-top: 24px;
}

.quick-add h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--accent);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.chip-hashtag {
    color: #7856ff;
}

.chip-hashtag:hover {
    background: rgba(120, 86, 255, 0.1);
    border-color: #7856ff;
}

/* ========================================
   Type Toggle (modal)
   ======================================== */

.type-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.network-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 2px;
}

.network-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.network-btn:first-child {
    border-right: 1px solid var(--border-color);
}

.network-btn.active[data-network="bluesky"] {
    background: #1185fe;
    color: #fff;
}

.network-btn.active[data-network="mastodon"] {
    background: #6364ff;
    color: #fff;
}

.network-btn:not(.active):hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.type-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.type-btn:first-child {
    border-right: 1px solid var(--border-color);
}

.type-btn.active {
    background: var(--accent);
    color: #fff;
}

.type-btn:not(.active):hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 440px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-with-prefix {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.input-with-prefix:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-with-prefix .prefix {
    padding: 10px 4px 10px 14px;
    color: var(--text-tertiary);
    font-size: 15px;
    font-weight: 500;
    user-select: none;
}

.input-with-prefix input {
    flex: 1;
    padding: 10px 14px 10px 4px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

.input-full {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: all var(--transition-fast);
}

.input-full:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-full::placeholder,
.input-with-prefix input::placeholder {
    color: var(--text-tertiary);
}

.color-options {
    display: flex;
    gap: 10px;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-card);
}

/* ========================================
   Notification Toast
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    color: var(--text-primary);
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 360px;
}

.toast.removing {
    animation: toastOut 0.25s ease-in forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--accent); }

/* ========================================
   Drag & Drop
   ======================================== */

.column.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.column.drag-over {
    border-left: 3px solid var(--accent);
}

/* ========================================
   Column context menu 
   ======================================== */

.context-menu {
    position: absolute;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    min-width: 180px;
    animation: menuIn 0.15s ease-out;
}

@keyframes menuIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
}

.context-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.context-menu button:hover {
    background: var(--bg-hover);
}

.context-menu button svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.context-menu button.danger {
    color: var(--danger);
}

.context-menu button.danger svg {
    color: var(--danger);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Submenu in context menu */
.submenu-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.submenu-label svg {
    width: 14px;
    height: 14px;
}

.submenu-items {
    display: flex;
    flex-direction: column;
}

.submenu-items button {
    padding-left: 20px !important;
    font-size: 12px !important;
}

.submenu-items button.active {
    color: var(--accent) !important;
    background: var(--accent-soft);
}

.submenu-items button.active::after {
    content: '✓';
    margin-left: auto;
    font-size: 12px;
    color: var(--accent);
}

.menu-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Refresh badge */
.refresh-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    font-size: 11px;
    vertical-align: middle;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {

    /* ══════════════════════════════════════════
       SIDEBAR → BOTTOM TAB BAR
       ══════════════════════════════════════════ */

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100% !important;
        height: 58px;
        min-height: 58px;
        flex-direction: row;
        align-items: stretch;
        justify-content: space-around;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 200;
        overflow: visible;
        transition: none;
    }

    /* Block hover expansion on touch devices */
    .sidebar:hover {
        width: 100% !important;
        height: 58px;
    }

    .sidebar:hover .logo-text,
    .sidebar:hover .nav-btn span {
        opacity: 0 !important;
        width: 0 !important;
        margin-left: 0 !important;
        display: none;
    }

    /* No logo in the bottom nav */
    .sidebar-logo {
        display: none;
    }

    /* Nav: horizontal row, full width */
    .sidebar-nav {
        flex-direction: row;
        flex: 1;
        justify-content: space-around;
        padding: 0;
        gap: 0;
    }

    .sidebar-bottom {
        padding: 0;
        width: auto;
        display: flex;
        align-items: stretch;
    }

    /* Each tab button: centered icon, full height */
    .nav-btn {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        width: auto;
        flex: 1;
        height: 58px;
        border-radius: 0;
        position: relative;
    }

    .nav-btn svg {
        width: 22px;
        height: 22px;
    }

    /* Hide text labels in bottom nav */
    .nav-btn span {
        display: none;
    }

    /* Active tab: top indicator line */
    .nav-btn.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 25%;
        right: 25%;
        height: 2px;
        background: var(--accent);
        border-radius: 0 0 2px 2px;
    }

    /* ══════════════════════════════════════════
       MAIN: full width, room for bottom nav
       ══════════════════════════════════════════ */

    .main {
        width: 100vw;
        padding-bottom: 58px;
    }

    /* ══════════════════════════════════════════
       TOPBAR: compact — no useless title
       ══════════════════════════════════════════ */

    .topbar {
        height: 52px;
        min-height: 52px;
        padding: 0 12px;
        gap: 8px;
    }

    /* Remove "Dashboard" — not useful on mobile */
    .topbar-title {
        display: none;
    }

    .topbar-left {
        gap: 0;
        flex-shrink: 0;
    }

    /* Column count: compact pill badge */
    .topbar-count {
        font-size: 12px;
        font-weight: 600;
        padding: 4px 10px;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-full);
        white-space: nowrap;
        color: var(--text-secondary);
    }

    /* Right: search + add */
    .topbar-right {
        flex: 1;
        gap: 8px;
        justify-content: flex-end;
    }

    .search-box {
        min-width: 0;
        flex: 1;
        max-width: 180px;
        padding: 7px 12px;
    }

    /* Add button: icon only */
    .btn-primary {
        padding: 9px 12px;
        flex-shrink: 0;
    }

    .btn-primary span {
        display: none;
    }

    .btn-primary svg {
        width: 18px;
        height: 18px;
    }

    /* ══════════════════════════════════════════
       COLUMNS: full-width, snap scroll (swipe)
       ══════════════════════════════════════════ */

    .columns-wrapper {
        overflow: hidden;
    }

    .columns {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        gap: 0;
    }

    .column {
        width: 100vw;
        min-width: 100vw;
        scroll-snap-align: start;
        border-right: none;
        border-radius: 0;
    }

    /* Hide desktop arrow navigation — swipe instead */
    .col-nav-btn {
        display: none !important;
    }

    /* ══════════════════════════════════════════
       MODAL: bottom sheet
       ══════════════════════════════════════════ */

    .modal-overlay {
        align-items: flex-end;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(20px);
        overflow-y: auto;
    }

    .modal-overlay.active .modal {
        transform: translateY(0);
    }

    /* ══════════════════════════════════════════
       TOAST: above bottom nav
       ══════════════════════════════════════════ */

    .toast-container {
        bottom: 70px;
        right: 12px;
        left: 12px;
    }

    .toast {
        max-width: 100%;
    }

    /* ══════════════════════════════════════════
       SETTINGS: full-width, mobile-friendly
       ══════════════════════════════════════════ */

    .settings-panel {
        padding: 16px;
    }

    .settings-content {
        max-width: 100%;
    }

    .settings-row {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }

    /* ══════════════════════════════════════════
       EMPTY STATE: tighter padding
       ══════════════════════════════════════════ */

    .empty-state {
        padding: 24px 20px;
    }

    /* ══════════════════════════════════════════
       SPLASH: tighter on mobile
       ══════════════════════════════════════════ */

    .splash-title {
        font-size: 36px;
    }

    .splash-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
        text-align: center;
    }

    .splash-search-box {
        padding: 12px 18px;
    }

    .splash-net-btn {
        padding: 7px 14px;
        font-size: 13px;
    }

    .splash-chips {
        gap: 6px;
    }

    .splash-chip {
        padding: 7px 13px;
        font-size: 12px;
    }
}

/* ========================================
   Twitter embed overrides
   ======================================== */

.twitter-timeline {
    border: none !important;
}

/* Force dark theme on twitter embeds */
.twitter-timeline-rendered {
    border-radius: 0 !important;
}

/* Iframe container to handle embed */
.embed-container {
    flex: 1;
    width: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block;
}

/* ── Feed container (client-side rendered posts) ── */
.feed-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.feed-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.feed-header-info {
    flex: 1;
    min-width: 0;
}

.feed-header-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.feed-header-handle {
    font-size: 13px;
    color: var(--text-secondary);
}

.feed-header-tag {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.feed-header-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.feed-net-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}

.badge-bluesky {
    background: rgba(17, 133, 254, 0.15);
    color: #1185fe;
}

.badge-mastodon {
    background: rgba(99, 100, 255, 0.15);
    color: #6364ff;
}

.badge-lemmy {
    background: rgba(255, 99, 20, 0.15);
    color: #ff6314;
}

/* ── Post styles ── */
.feed-post-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.feed-post {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.feed-post:hover {
    background: var(--bg-hover);
}

.feed-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.feed-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    font-size: 16px;
}

.feed-post-right {
    flex: 1;
    min-width: 0;
}

.feed-post-meta {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 12px;
}

.feed-post-name {
    font-weight: 700;
    color: var(--text-primary);
}

.feed-post-handle {
    color: var(--text-secondary);
    font-size: 11px;
}

.feed-post-time {
    color: var(--text-secondary);
    font-size: 11px;
}

.feed-post-time::before {
    content: "· ";
}

.feed-post-text {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    color: var(--text-primary);
}

.feed-post-text a {
    color: var(--accent);
    text-decoration: none;
}

.feed-post-text a:hover {
    text-decoration: underline;
}

.feed-post-text p {
    margin-bottom: 4px;
}

.feed-media {
    margin-top: 7px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.feed-media img,
.feed-media video {
    width: 100%;
    display: block;
    max-height: 240px;
    object-fit: cover;
}

.feed-media-grid {
    display: grid;
    gap: 2px;
    margin-top: 7px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.feed-media-2 {
    grid-template-columns: 1fr 1fr;
}

.feed-media-3,
.feed-media-4 {
    grid-template-columns: 1fr 1fr;
}

.feed-media-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.feed-card {
    display: block;
    margin-top: 7px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast);
}

.feed-card:hover {
    background: var(--bg-hover);
}

.feed-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.feed-card-body {
    padding: 8px 10px;
}

.feed-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.feed-card-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.feed-quote {
    margin-top: 7px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
}

.feed-quote-header {
    font-size: 13px;
}

.feed-quote-text {
    font-size: 12px;
    margin-top: 3px;
    color: var(--text-primary);
}

.feed-actions {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.feed-action {
    display: flex;
    align-items: center;
    gap: 4px;
}

.feed-boost-info {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 16px 0 66px;
}

/* Loading spinner for feed */
.feed-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-tertiary);
}

.feed-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.feed-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    text-align: center;
    color: var(--text-secondary);
}

.feed-error .feed-error-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.feed-error h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.feed-error p {
    font-size: 13px;
    line-height: 1.5;
}

.feed-error button {
    margin-top: 8px;
    padding: 8px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}

.feed-error button:hover {
    opacity: 0.85;
}

/* Internal links (hashtags & mentions → new column) */
.feed-internal-link {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

.feed-internal-link:hover {
    text-decoration: underline;
}

/* Twitter widget rendered inside embed-container */
.embed-container .twitter-timeline-rendered,
.embed-container .twitter-timeline {
    width: 100% !important;
    height: 100% !important;
}

/* Hide fallback link text */
.embed-container > a {
    display: none !important;
}

/* Error state in column */
.column-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    text-align: center;
    color: var(--text-secondary);
}

.column-error svg {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
}

.column-error p {
    font-size: 14px;
    line-height: 1.5;
}

.column-error .btn-secondary {
    margin-top: 8px;
    font-size: 13px;
    padding: 8px 16px;
}

/* ========================================
   Column Nav Buttons (◀ ▶)
   ======================================== */

.col-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 40px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.col-nav-left  { left: 0;  border-radius: 0 var(--radius-md) var(--radius-md) 0; border-left: none; }
.col-nav-right { right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md); border-right: none; }

.col-nav-btn:hover {
    background: var(--bg-elevated);
    color: var(--accent);
}

.col-nav-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.col-nav-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Settings Panel
   ======================================== */

.settings-panel {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    background: var(--bg-primary);
}

.settings-panel.hidden {
    display: none;
}

.settings-content {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.settings-section-header svg {
    width: 15px;
    height: 15px;
    opacity: 0.7;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

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

.settings-row:hover {
    background: var(--bg-hover);
}

.settings-row-danger:hover {
    background: rgba(255, 68, 68, 0.04);
}

.settings-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.settings-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.settings-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    width: 200px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.settings-input:focus {
    border-color: #1185fe;
}

.settings-input::placeholder {
    color: var(--text-tertiary);
}

.settings-badge {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* Language toggle */
.lang-toggle {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.lang-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.5px;
    font-family: inherit;
}

.lang-btn:hover {
    border-color: #1185fe;
    color: #1185fe;
}

.lang-btn.active {
    background: #1185fe;
    border-color: #1185fe;
    color: #fff;
}

.settings-import-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-danger {
    background: transparent;
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: #ff4444;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-danger:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: #ff4444;
}

/* ========================================
   Export Modal
   ======================================== */

.export-modal {
    width: 480px;
}

.export-summary-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.export-summary-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1185fe22, #7856ff22);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.export-summary-icon svg {
    width: 22px;
    height: 22px;
    color: #1185fe;
}

.export-summary-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.export-summary-sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
}

.export-filename-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.export-filename-row .input-full {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
    flex: 1;
}

.export-filename-row .input-full:focus {
    border-color: #1185fe;
    z-index: 1;
    position: relative;
}

.export-ext {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0 12px;
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
