/* Lable.app Styles — aligned with admin grey + accent blue */

:root {
    --board-bg: #f0f0f2;
    --board-panel: #ffffff;
    --board-column: #ffffff;
    --board-card: #ffffff;
    --board-border: rgba(15, 15, 18, 0.08);
    --board-secondary: #1a1a1f;
    --board-muted: #6b6b73;
    --accent-blue: #3498db;
    --accent-blue-soft: rgba(52, 152, 219, 0.15);
    --brand-yellow: #FCD80C;
    --brand-red: #E90607;
}

.dark {
    --board-bg: #0f0f12;
    --board-panel: rgba(30, 30, 36, 0.9);
    --board-column: #1a1a1f;
    --board-card: #1e1e24;
    --board-border: rgba(255, 255, 255, 0.08);
    --board-muted: #a0a0a8;
}

.board-scroll {
    display: grid;
    width: 100%;
    gap: 0.75rem;
    overflow-x: hidden;
    /* Mobile: one full-width column stacked vertically */
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
    .board-scroll {
        gap: 0.85rem;
        /* Large phones / small tablets: 2 columns */
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .board-scroll {
        gap: 1rem;
        /* Tablet: 3 columns */
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .board-scroll {
        gap: 1rem;
        /* Desktop: all board columns share one row */
        grid-template-columns: repeat(var(--col-count, 5), minmax(0, 1fr));
    }
}

.board-column {
    background: var(--board-column);
    border: 1px solid var(--board-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    min-width: 0;
    width: 100%;
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

body {
    overflow-x: hidden;
    width: 100vw;
}

/* Navbar — subtle admin-style edge */
nav.bg-primary {
    border-bottom: 1px solid var(--board-border);
    box-shadow: none;
}

/* Shared panel / column surfaces */
.board-panel {
    background: var(--board-panel);
    border: 1px solid var(--board-border);
}

/* Filter bar — icon controls on mobile, labeled selects on desktop */
.filter-bar {
    overflow: hidden;
}

.filter-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
}

.filter-control-icon,
.filter-control-caret {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
    font-size: 0.8rem;
    color: var(--accent-blue);
}

.filter-control-icon {
    left: 0.7rem;
}

.filter-control-caret {
    right: 0.65rem;
    color: var(--board-muted);
    font-size: 0.75rem;
}

.filter-control.is-active {
    outline: 1px solid rgba(52, 152, 219, 0.45);
    border-radius: 0.55rem;
}

.filter-control.is-active .filter-control-icon,
.filter-control.is-active .filter-control-caret {
    color: var(--accent-blue);
}

.filter-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 0.55rem;
    border: 1px solid rgba(15, 15, 18, 0.08);
    background: #fff;
    color: inherit;
    font-size: 0.875rem;
    line-height: 1.25rem;
    padding: 0.45rem 1.7rem 0.45rem 2rem;
    cursor: pointer;
}

.dark .filter-select {
    background: var(--board-secondary);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-select:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.55);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.18);
}

/* Mobile: compact icon + caret only (no wrapping text labels) */
@media (max-width: 639px) {
    .filter-control {
        flex: 0 0 auto;
        width: 2.75rem;
    }

    .filter-select {
        width: 2.75rem;
        height: 2.5rem;
        padding: 0;
        color: transparent !important;
        text-indent: -999px;
        overflow: hidden;
    }

    .filter-select option {
        color: #111;
        text-indent: 0;
    }

    .dark .filter-select option {
        color: #fff;
    }

    .filter-control-icon {
        left: 50%;
        transform: translate(-55%, -55%);
        font-size: 0.85rem;
    }

    .filter-control-caret {
        right: 0.2rem;
        bottom: 0.15rem;
        top: auto;
        transform: none;
        font-size: 0.65rem;
    }
}

@media (min-width: 640px) {
    .filter-control {
        flex: 1 1 9rem;
        max-width: 14rem;
    }
}

.column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    background: var(--accent-blue-soft);
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.ticket-id {
    color: var(--accent-blue) !important;
    background: var(--accent-blue-soft) !important;
    border: 1px solid rgba(52, 152, 219, 0.25);
    font-weight: 600;
}

/* Task Cards */
.task-card {
    background: var(--board-card);
    border-top: 1px solid var(--board-border);
    border-right: 1px solid var(--board-border);
    border-bottom: 1px solid var(--board-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.task-card.sortable-ghost {
    opacity: 0.4;
    background: #e8e8ea;
}

.dark .task-card.sortable-ghost {
    background: #242429;
}

.task-list.sortable-drag {
    background: rgba(52, 152, 219, 0.06);
}

/* Text utilities */
.tap-highlight-transparent {
    -webkit-tap-highlight-color: transparent;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.task-card h3,
.task-card p {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Custom scrollbar */
.task-list::-webkit-scrollbar {
    width: 8px;
}

.task-list::-webkit-scrollbar-track {
    background: transparent;
}

.task-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

.task-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.22);
}

.dark .task-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

.dark .task-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Dark Mode Styles ===== */

.dark .task-card {
    background: var(--board-card);
    border-color: var(--board-border);
}

.dark .task-card h3 {
    color: #f3f4f6;
}

.dark .task-card p {
    color: var(--board-muted);
}

/* Dark mode: Modals and dropdowns */
.dark .modal-content,
.dark .dropdown-panel {
    background: #1a1a1f;
    color: #f3f4f6;
    border-color: var(--board-border);
}

/* Board selector — admin greys + accent, light + dark */
.boards-menu {
    background: #0f0f12;
    color: #e8e8ec;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.boards-menu-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.boards-menu-header h6 {
    color: #f3f4f6 !important;
    margin: 0;
}

.boards-menu-section {
    color: #a0a0a8 !important;
    letter-spacing: 0.04em;
}

.boards-menu-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.boards-menu-row {
    color: #e8e8ec;
    transition: background 0.15s ease;
}

.boards-menu-row:hover {
    background: #1a1a1f;
}

.boards-menu-row-active {
    background: rgba(52, 152, 219, 0.15);
}

.boards-menu-row-active:hover {
    background: rgba(52, 152, 219, 0.22);
}

.boards-menu-icon {
    color: #a0a0a8;
}

.boards-menu-muted {
    color: #6b6b73 !important;
}

.boards-menu-action {
    color: #6b6b73;
    flex-shrink: 0;
}

.boards-menu .boards-menu-header span,
.boards-menu .boards-menu-row span {
    color: inherit;
}

/* Dark mode: Form inputs */
.dark input,
.dark textarea,
.dark select {
    background: #1e1e24;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
}

.dark input::placeholder {
    color: #6b6b73;
}

.dark label {
    color: #a0a0a8;
}

/* Dark mode: Loading overlay */
.dark .loading-box {
    background: #1a1a1f;
}

.dark .loading-box span {
    color: #d1d5db;
}

/* Dark mode: Dropdown items */
.dark .dropdown-panel .hover\:bg-gray-100:hover {
    background: #242429 !important;
}

.dark .dropdown-panel h6,
.dark .dropdown-panel span {
    color: #e5e7eb;
}

/* ===== Toast Notifications ===== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    max-width: 350px;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

.toast.warning {
    background: #f59e0b;
}

.toast.info {
    background: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== Due Date Colors ===== */

.due-overdue {
    color: #ef4444 !important;
    font-weight: 600;
}

.due-soon {
    color: #f59e0b !important;
    font-weight: 600;
}

.due-ok {
    color: #10b981 !important;
}

/* ===== Task Type Icons ===== */

.type-icon {
    margin-right: 6px;
}

.type-bug {
    color: #ef4444;
}

.type-story {
    color: #3498db;
}

.type-task {
    color: #6b6b73;
}

.type-epic {
    color: #a855f7;
}

/* ===== Auth Pages — match board tokens + frameless modal chrome ===== */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--board-bg);
    background-image:
        radial-gradient(ellipse 80% 55% at 12% 18%, rgba(252, 216, 12, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 88% 82%, rgba(52, 152, 219, 0.08), transparent 50%),
        radial-gradient(ellipse 90% 70% at 50% 100%, rgba(15, 15, 18, 0.04), transparent 60%);
    background-attachment: fixed;
}

.dark .auth-page {
    background-image:
        radial-gradient(ellipse 75% 50% at 15% 12%, rgba(252, 216, 12, 0.12), transparent 55%),
        radial-gradient(ellipse 65% 45% at 90% 88%, rgba(52, 152, 219, 0.1), transparent 50%),
        radial-gradient(ellipse 100% 80% at 50% 120%, rgba(0, 0, 0, 0.45), transparent 55%);
}

.auth-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .auth-container {
        align-items: center;
        padding: 2rem 1rem;
    }
}

.auth-box {
    width: 100%;
    max-width: 400px;
    margin-top: auto;
    margin-bottom: auto;
    padding: 1.75rem 1.5rem;
    background: var(--board-panel);
    border: 1px solid var(--board-border);
    border-radius: 0.5rem;
    box-shadow: 0 8px 28px rgba(15, 15, 18, 0.08);
}

.dark .auth-box {
    background: #1a1a1f;
    border-color: var(--board-border);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(15, 15, 18, 0.12);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    background: #fff;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .auth-input {
    background: #1e1e24;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.auth-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: #2980b9;
}

.auth-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.auth-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.dark .auth-error {
    background: rgba(127, 29, 29, 0.45);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.25);
}

/* ===== LABLE Tag Styles ===== */

.lable-tag {
    display: inline-block;
    background: transparent;
    color: var(--brand-yellow);
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border: none;
    line-height: 1;
}

.lable-tag:hover {
    opacity: 0.85;
}

.lable-tag:active {
    opacity: 0.7;
}

/* ===== LABLE Modal — frameless, matches app-modal chrome ===== */

.lable-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    padding-top: 2rem;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lable-modal-overlay::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.lable-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.lable-modal {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem 1.5rem;
    max-width: 400px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin-top: auto;
    margin-bottom: auto;
    position: relative;
    border: 1px solid var(--board-border);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    animation: modalSlideIn 0.25s ease;
}

.lable-modal::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.dark .lable-modal {
    background: #1a1a1f;
    border-color: var(--board-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lable-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--board-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.lable-modal-close:hover {
    color: #1f2937;
}

.dark .lable-modal-close:hover {
    color: #f3f4f6;
}

.lable-acronym-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lable-acronym-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--board-border);
    color: #374151;
    font-size: 15px;
    line-height: 1.5;
}

.dark .lable-acronym-list li {
    border-bottom-color: var(--board-border);
    color: #d1d5db;
}

.lable-acronym-list li:last-child {
    border-bottom: none;
}

/* Frameless popup modals — fit viewport, scroll inside panel, hide scrollbars */
.app-modal-overlay,
.ticket-modal-overlay {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Override Tailwind items-center: centered tall panels clip the top (close button) */
    align-items: flex-start !important;
}

.app-modal-overlay::-webkit-scrollbar,
.ticket-modal-overlay::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.app-modal-panel,
.ticket-modal-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    max-height: calc(100svh - 2rem);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* With overlay align-items:start, auto margins keep short panels vertically centered */
    margin-top: auto;
    margin-bottom: auto;
}

.app-modal-panel::-webkit-scrollbar,
.ticket-modal-panel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Keep title + close reachable while body scrolls */
.app-modal-header,
.app-modal-panel > :first-child,
.ticket-modal-panel > :first-child {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-shrink: 0;
    background-color: #fff;
}

.dark .app-modal-header,
.dark .app-modal-panel > :first-child,
.dark .ticket-modal-panel > :first-child {
    background-color: #1f2937; /* gray-800 */
}

.dark .app-modal-panel.modal-content > :first-child,
.dark .ticket-modal-panel.modal-content > :first-child,
.dark .modal-content > .app-modal-header {
    background-color: #1a1a1f;
}

.app-modal-body {
    flex: 1 1 auto;
    min-height: 0;
}

/* Nested scroll regions inside modals (scroll works, bar hidden) */
.app-modal-scroll {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-modal-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.acronym-letter {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: var(--brand-yellow);
    color: var(--brand-red);
    font-weight: 700;
    text-align: center;
    line-height: 28px;
    border-radius: 6px;
    margin-right: 8px;
    font-size: 16px;
    border: 1px solid var(--brand-yellow);
}
