/* ==========================================================
   AMBERTRACK PM BOARD
   Industrial-refined aesthetic with game engine console feel
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=JetBrains+Mono:wght@400;500;600&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Amber palette */
    --amber-100: #FBF0E4;
    --amber-300: #E8A87C;
    --amber-400: #D4915C;
    --amber-500: #C07A3E;
    --amber-600: #A66530;
    --amber-glow: rgba(212, 145, 92, 0.15);
    --amber-glow-strong: rgba(212, 145, 92, 0.35);

    /* Slate/charcoal */
    --bg-deep: #0E0F14;
    --bg-primary: #141519;
    --bg-elevated: #1A1B22;
    --bg-card: #1E1F28;
    --bg-card-hover: #24252F;
    --border: #2A2B36;
    --border-subtle: #222330;

    /* Text */
    --text-primary: #E8E4DE;
    --text-secondary: #9B978F;
    --text-muted: #5E5B55;
    --text-inverse: #0E0F14;

    /* Status accents */
    --status-todo: #7B8794;
    --status-progress: #D4915C;
    --status-review: #9F8FD4;
    --status-done: #6BAF7B;
    --status-blocked: #C75D5D;

    /* Priority */
    --prio-low: #6BAF7B;
    --prio-medium: #D4C15C;
    --prio-high: #D4915C;
    --prio-critical: #C75D5D;

    /* Fonts */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Sizing */
    --column-width: 300px;
    --radius: 6px;
    --radius-lg: 10px;
}

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

/* Background texture */
body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, var(--amber-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(159, 143, 212, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ---- NAVBAR ---- */
.navbar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    height: 56px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--amber-400);
    letter-spacing: -0.02em;
    position: relative;
}

.nav-brand::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--amber-400), transparent);
    opacity: 0.6;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ---- BUTTONS ---- */
.btn {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s ease;
}

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

.btn-primary {
    background: var(--amber-500);
    border-color: var(--amber-500);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--amber-400);
    border-color: var(--amber-400);
    box-shadow: 0 0 20px var(--amber-glow-strong);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 10px;
}

/* ---- CONTAINER ---- */
.container {
    position: relative;
    z-index: 1;
    padding: 24px 32px;
}

/* ---- BOARD HEADER ---- */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 28px;
    animation: fadeSlideDown 0.4s ease both;
}

.board-header h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ---- KANBAN BOARD ---- */
.board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 24px;
    min-height: calc(100vh - 160px);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.board::-webkit-scrollbar {
    height: 6px;
}

.board::-webkit-scrollbar-track {
    background: transparent;
}

.board::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ---- COLUMNS ---- */
.column {
    flex: 0 0 var(--column-width);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeSlideUp 0.5s ease both;
}

.column:nth-child(1) { animation-delay: 0.05s; }
.column:nth-child(2) { animation-delay: 0.1s; }
.column:nth-child(3) { animation-delay: 0.15s; }
.column:nth-child(4) { animation-delay: 0.2s; }
.column:nth-child(5) { animation-delay: 0.25s; }

/* Column status indicators */
.column[data-status="todo"] .column-header { --col-accent: var(--status-todo); }
.column[data-status="in_progress"] .column-header { --col-accent: var(--status-progress); }
.column[data-status="review"] .column-header { --col-accent: var(--status-review); }
.column[data-status="done"] .column-header { --col-accent: var(--status-done); }
.column[data-status="blocked"] .column-header { --col-accent: var(--status-blocked); }

.column-header {
    --col-accent: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-primary) 100%);
    position: relative;
}

.column-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--col-accent);
    opacity: 0.7;
}

.status-icon {
    font-size: 14px;
    filter: grayscale(0.2);
}

.count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-deep);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    min-width: 24px;
    text-align: center;
}

/* ---- CARDS CONTAINER ---- */
.cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 60px;
    padding: 10px;
}

/* ---- TASK CARD ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 12px 14px;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    opacity: 0;
    background: linear-gradient(135deg, var(--amber-glow) 0%, transparent 60%);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.card:hover {
    border-color: var(--border);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--border);
}

.card:hover::before {
    opacity: 1;
}

.card:active {
    cursor: grabbing;
}

.card.sortable-ghost {
    opacity: 0.3;
    border: 1px dashed var(--amber-400);
    background: var(--bg-deep);
}

.card.sortable-drag {
    transform: rotate(2deg) scale(1.02);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px var(--amber-400);
    z-index: 999;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-id {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--amber-400);
    opacity: 0.8;
    letter-spacing: 0.03em;
}

.card-priority {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.priority-low {
    background: rgba(107, 175, 123, 0.12);
    color: var(--prio-low);
    border: 1px solid rgba(107, 175, 123, 0.2);
}

.priority-medium {
    background: rgba(212, 193, 92, 0.12);
    color: var(--prio-medium);
    border: 1px solid rgba(212, 193, 92, 0.2);
}

.priority-high {
    background: rgba(212, 145, 92, 0.12);
    color: var(--prio-high);
    border: 1px solid rgba(212, 145, 92, 0.2);
}

.priority-critical {
    background: rgba(199, 93, 93, 0.15);
    color: var(--prio-critical);
    border: 1px solid rgba(199, 93, 93, 0.25);
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.card-gdd-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(212, 145, 92, 0.15);
    color: var(--amber-400);
    border: 1px solid rgba(212, 145, 92, 0.25);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: all 0.15s ease;
}

.card-gdd-badge:hover {
    background: rgba(212, 145, 92, 0.3);
    color: var(--amber-300);
}

.card-deadline {
    opacity: 0.8;
}

.card-assignee {
    opacity: 0.8;
}

/* ---- 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: 100;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal label {
    display: block;
    margin-bottom: 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.modal input,
.modal textarea,
.modal select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px var(--amber-glow);
}

.modal textarea {
    resize: vertical;
    min-height: 60px;
}

.modal select {
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* ---- LOGIN PAGE ---- */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    animation: fadeSlideUp 0.6s ease both;
}

.login-container h1 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 400;
    color: var(--amber-300);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    position: relative;
}

.login-container h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--amber-400), transparent);
    margin: 12px auto 0;
}

.login-container p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    max-width: 320px;
    line-height: 1.6;
}

.hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin-bottom: 28px;
}

.error {
    color: var(--prio-critical);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ---- ANIMATIONS ---- */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .container {
        padding: 16px;
    }

    .board-header h2 {
        font-size: 22px;
    }

    .column {
        flex: 0 0 260px;
    }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- SELECTION ---- */
::selection {
    background: var(--amber-glow-strong);
    color: var(--text-primary);
}
