/* Game Task Board – styles */

:root {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --border: #e3e6eb;
    --text: #1f2937;
    --muted: #6b7280;
    --brand: #0f766e;
    --brand-hover: #0d9488;
    --todo: #64748b;
    --progress: #2563eb;
    --testing: #d97706;
    --done: #16a34a;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* ---------- Login ---------- */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 40%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.08), transparent 35%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-brand i {
    font-size: 2rem;
    color: var(--brand);
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem;
}

.login-brand p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-hover);
    border-color: var(--brand-hover);
}

/* ---------- Header ---------- */

.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 1.15rem;
}

.brand i {
    color: var(--brand);
    font-size: 1.35rem;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ---------- Board layout ---------- */

.board-main {
    padding: 1.25rem 1.25rem 2rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.toolbar-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    flex: 1;
}

.toolbar-right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.import-help a {
    color: var(--brand);
    text-decoration: none;
}

.import-help a:hover {
    text-decoration: underline;
}

.search-wrap {
    position: relative;
    min-width: 220px;
    flex: 1;
    max-width: 320px;
}

.search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search-wrap .form-control {
    padding-left: 2.2rem;
}

.toolbar .form-select {
    width: auto;
    min-width: 160px;
}

.counters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.counter-item strong {
    color: var(--text);
    margin-right: 0.2rem;
}

.counter-item.status-todo strong { color: var(--todo); }
.counter-item.status-progress strong { color: var(--progress); }
.counter-item.status-testing strong { color: var(--testing); }
.counter-item.status-done strong { color: var(--done); }

.board-loading,
.board-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--muted);
    text-align: center;
}

.board-empty i {
    font-size: 2.5rem;
    opacity: 0.7;
}

.board-empty h2 {
    font-size: 1.25rem;
    color: var(--text);
    margin: 0;
}

.board-empty p {
    margin: 0;
}

/* ---------- Kanban ---------- */

.kanban-board {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.kanban-board::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.kanban-column {
    background: #e8ecf1;
    border-radius: var(--radius);
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    height: calc(100vh - 240px);
    min-height: 360px;
    max-height: calc(100vh - 240px);
    display: flex;
    flex-direction: column;
    border: 1px solid #d8dee6;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem 0.5rem;
    flex-shrink: 0;
}

.column-header h2 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 1;
}

.column-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.column-dot.todo { background: var(--todo); }
.column-dot.in_progress { background: var(--progress); }
.column-dot.testing { background: var(--testing); }
.column-dot.done { background: var(--done); }
.column-dot.developer { background: #0f766e; }
.column-dot.unassigned { background: #94a3b8; }
.column-dot.category { background: #7c3aed; }
.column-dot.uncategorized { background: #94a3b8; }

.column-count {
    background: rgba(15, 23, 42, 0.08);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.column-body {
    flex: 1;
    min-height: 0;
    padding: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.column-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.column-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1.5rem 0.5rem;
    pointer-events: none;
}

/* ---------- Task card ---------- */

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 0.55rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: grab;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.task-card:hover {
    box-shadow: var(--shadow);
}

.task-card:active,
.task-card.sortable-chosen {
    cursor: grabbing;
}

.task-card.sortable-ghost {
    opacity: 0.45;
}

.task-card.filtered-out {
    display: none !important;
}

.task-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    line-height: 1.35;
    word-break: break-word;
}

.task-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0 0 0.65rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
}

.tag-input-field-wrap {
    position: relative;
}

.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 42px;
    padding: 0.35rem 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background: #fff;
    cursor: text;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tag-input-wrap:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.tag-input-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.tag-input-field {
    flex: 1 1 120px;
    min-width: 120px;
    border: 0;
    outline: none;
    padding: 0.2rem 0.35rem;
    font-size: 0.95rem;
    background: transparent;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding-right: 0.25rem;
}

.tag-chip-remove {
    border: 0;
    background: transparent;
    color: #4338ca;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
    opacity: 0.75;
}

.tag-chip-remove:hover {
    opacity: 1;
}

.tag-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1056;
    max-height: 180px;
    overflow-y: auto;
    border-radius: 0.375rem;
    box-shadow: var(--shadow);
}

.tag-suggestion-item {
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
}

.badge-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    line-height: 1.3;
}

.badge-category {
    font-weight: 500;
    font-size: 0.72rem;
    border-radius: 6px;
    padding: 0.25rem 0.45rem;
}

.badge-cat-development { background: #dbeafe; color: #1e40af; }
.badge-cat-design { background: #fce7f3; color: #9d174d; }
.badge-cat-testing { background: #ffedd5; color: #9a3412; }
.badge-cat-art { background: #ede9fe; color: #5b21b6; }
.badge-cat-audio { background: #d1fae5; color: #065f46; }
.badge-cat-other { background: #e5e7eb; color: #374151; }

.badge-status {
    font-weight: 600;
    font-size: 0.7rem;
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-status.status-todo { background: #e2e8f0; color: #475569; }
.badge-status.status-in_progress { background: #dbeafe; color: #1d4ed8; }
.badge-status.status-testing { background: #ffedd5; color: #c2410c; }
.badge-status.status-done { background: #dcfce7; color: #15803d; }

.task-assignee {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted);
    margin-left: auto;
}

.task-assignee i {
    font-size: 0.9rem;
}

/* ---------- Toast variants ---------- */

#appToast.toast-success {
    background: #166534;
    color: #fff;
}

#appToast.toast-error {
    background: #b91c1c;
    color: #fff;
}

#appToast.toast-info {
    background: #1e40af;
    color: #fff;
}

.users-table code {
    font-size: 0.85em;
}

.add-user-panel .form-label {
    font-size: 0.85rem;
}

/* ---------- Password fields ---------- */

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-left: 2.35rem;
    padding-right: 2.6rem;
}

.password-field-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    font-size: 1rem;
    z-index: 2;
}

.password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0;
    z-index: 2;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--text);
    background: rgba(15, 23, 42, 0.06);
    outline: none;
}

.password-toggle .bi {
    font-size: 1.05rem;
}

.password-field .form-control-lg {
    padding-left: 2.6rem;
    padding-right: 2.85rem;
}

.password-field .form-control-lg ~ .password-field-icon {
    left: 1rem;
    font-size: 1.1rem;
}

.password-field .form-control-lg ~ .password-toggle {
    right: 0.45rem;
    width: 2.35rem;
    height: 2.35rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .kanban-column {
        flex: 0 0 260px;
        width: 260px;
        min-width: 260px;
        max-width: 260px;
        height: calc(100vh - 260px);
        max-height: calc(100vh - 260px);
    }
}

@media (max-width: 768px) {
    .board-main {
        padding: 1rem;
    }

    .toolbar-left {
        width: 100%;
    }

    .search-wrap {
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    .toolbar .form-select {
        flex: 1;
        min-width: 140px;
    }

    .toolbar-right {
        width: 100%;
    }

    .toolbar-right .btn {
        width: 100%;
    }

    .kanban-board {
        gap: 0.85rem;
    }

    .kanban-column {
        flex: 0 0 260px;
        width: 260px;
        min-width: 260px;
        max-width: 260px;
        height: calc(100vh - 300px);
        min-height: 320px;
        max-height: calc(100vh - 300px);
    }
}
