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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 68px;
}

/* Demo Toolbar */
.demo-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: #1a1a2e;
    font-family: 'Work Sans', sans-serif;
}

.demo-toolbar a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #5fa6a6;
    font-size: 1.25rem;
}

.demo-toolbar .logo {
    height: 40px;
}

.demo-toolbar .brand-wf {
    font-weight: 520;
}

.demo-toolbar .brand-js {
    font-weight: 700;
}

.demo-toolbar .demo-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.demo-toolbar .demo-info strong {
    color: #fff;
}

/* Kanban App */
.kanban-app {
    max-width: 1400px;
    margin: 0 auto;
}

.kanban-header {
    color: white;
    margin-bottom: 20px;
}

.kanban-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.kanban-header p {
    opacity: 0.9;
    font-size: 14px;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    min-width: 200px;
    max-width: 300px;
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
}

.search-box:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
}

.stats {
    display: flex;
    gap: 16px;
    color: white;
    font-size: 13px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
}

.stat-value {
    font-weight: 600;
}

.toolbar-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transition: background 0.2s;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.toolbar-btn.danger {
    background: rgba(235, 90, 70, 0.8);
}

.toolbar-btn.danger:hover {
    background: rgba(235, 90, 70, 1);
}

.toolbar-btn.tutorial {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-weight: 600;
}

.toolbar-btn.tutorial:hover {
    background: white;
}

/* Board */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    align-items: flex-start;
    justify-content: center;
}

.kanban-board > [data-list] {
    display: contents;
}

/* Columns */
.kanban-column {
    background: #ebecf0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 240px);
    transition: min-width 0.3s, max-width 0.3s;
}

.cols-3 .kanban-column {
    min-width: 300px;
    max-width: 300px;
}

.cols-4 .kanban-column {
    min-width: 260px;
    max-width: 260px;
}

.cols-5 .kanban-column {
    min-width: 220px;
    max-width: 220px;
}

.column-header {
    padding: 12px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.column-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-header-right {
    display: flex;
    align-items: center;
}

.column-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

/* Column Settings */
.column-settings-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
}

.column-settings-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

.column-settings-popover {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    padding: 16px;
    min-width: 220px;
    z-index: 100;
    color: #172b4d;
}

.settings-group {
    margin-bottom: 12px;
}

.settings-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #5e6c84;
    margin-bottom: 4px;
}

.settings-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    font-size: 14px;
}

.settings-color-row {
    display: flex;
    gap: 8px;
}

.settings-color-input {
    width: 50px;
    height: 36px;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    cursor: pointer;
}

.settings-color-hex {
    flex: 1;
    padding: 8px;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    font-size: 14px;
    font-family: monospace;
}

.settings-delete-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: #ffebe6;
    color: #eb5a46;
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 8px;
}

.settings-delete-btn:hover {
    background: #ffd6cc;
}

.settings-close-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: #f4f5f7;
    color: #5e6c84;
    cursor: pointer;
    font-size: 13px;
}

.settings-close-btn:hover {
    background: #dfe1e6;
}

/* Cards */
.card-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
    min-height: 100px;
}

.card {
    background: white;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card.priority-high {
    border-left: 3px solid #eb5a46;
}

.card.priority-medium {
    border-left: 3px solid #f2d600;
}

.card.priority-low {
    border-left: 3px solid #61bd4f;
}

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

.card-title {
    font-size: 14px;
    color: #172b4d;
    flex: 1;
}

.priority-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-badge.high {
    background: #ffebe6;
    color: #eb5a46;
}

.priority-badge.medium {
    background: #fff8e1;
    color: #b8860b;
}

.priority-badge.low {
    background: #e8f5e9;
    color: #388e3c;
}

.card-description {
    font-size: 12px;
    color: #5e6c84;
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.card-btn {
    border: none;
    background: #f4f5f7;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    color: #5e6c84;
}

.card-btn:hover {
    background: #dfe1e6;
}

.card-btn.delete {
    color: #eb5a46;
}

.card-btn.delete:hover {
    background: #ffebe6;
}

.card-btn.edit {
    color: #0079bf;
}

.card-btn.edit:hover {
    background: #e4f0f6;
}

/* Forms */
.add-card-section {
    padding: 8px;
}

.add-card-btn {
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    border-radius: 4px;
    color: #5e6c84;
}

.add-card-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #172b4d;
}

.new-card-form {
    background: white;
    border-radius: 6px;
    padding: 10px;
}

.new-card-form input,
.new-card-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 8px;
}

.new-card-form textarea {
    resize: vertical;
    min-height: 60px;
}

.priority-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.priority-option {
    flex: 1;
    padding: 6px;
    border: 2px solid #dfe1e6;
    border-radius: 4px;
    text-align: center;
    font-size: 11px;
    cursor: pointer;
}

.priority-option.high {
    color: #eb5a46;
}

.priority-option.high.selected {
    border-color: #eb5a46;
    background: #ffebe6;
}

.priority-option.medium {
    color: #b8860b;
}

.priority-option.medium.selected {
    border-color: #f2d600;
    background: #fff8e1;
}

.priority-option.low {
    color: #388e3c;
}

.priority-option.low.selected {
    border-color: #61bd4f;
    background: #e8f5e9;
}

.form-actions {
    display: flex;
    gap: 8px;
}

.form-actions button {
    flex: 1;
}

.btn-primary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #0079bf;
    color: white;
}

.btn-primary:hover {
    background: #026aa7;
}

.btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: #f4f5f7;
    color: #5e6c84;
}

.btn-secondary:hover {
    background: #dfe1e6;
}

/* Add Column */
.add-column-container {
    min-width: 140px;
}

.add-column-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-column-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #dfe1e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    color: #172b4d;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #5e6c84;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #5e6c84;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #dfe1e6;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Sortable */
.card.sortable-ghost {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    border: 2px dashed #0079bf;
    border-radius: 6px;
    box-shadow: none !important;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    padding: 0;
    overflow: hidden;
}

.card.sortable-ghost * {
    visibility: hidden;
}

.card.sortable-chosen {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
