/* css/style.css */

/* ==================== VARIABLES ==================== */
:root {
    /* Light mode (default) */
    --bg-page: #f5f5f5;
    --bg-lane: #ffffff;
    --bg-item: #ffffff;
    --bg-header: #1a1a2e;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-header: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --accent: #3498db;
    --accent-hover: #2980b9;
    --danger: #e74c3c;
    --danger-hover: #c0392b;
    --success: #27ae60;
}

[data-theme="dark"] {
    --bg-page: #1a1a2e;
    --bg-lane: #16213e;
    --bg-item: #0f3460;
    --bg-header: #0f0f1a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #30475e;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ==================== RESET & BASE ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* ==================== HEADER ==================== */
.header {
    background: var(--bg-header);
    color: var(--text-header);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-left {
    flex-shrink: 0;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.header-center {
    flex: 1;
    max-width: 400px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: background 0.3s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

.search-clear:hover {
    color: white;
}

.header-right {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Theme toggle icons */
.icon-dark {
    display: none;
}

[data-theme="dark"] .icon-light {
    display: none;
}

[data-theme="dark"] .icon-dark {
    display: inline;
}

/* ==================== BOARD ==================== */
.board-container {
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 64px);
    overflow-x: auto;
}

.board {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
}

/* ==================== LANES ==================== */
.lane {
    background: var(--bg-lane);
    border-radius: 12px;
    width: 300px;
    min-width: 300px;
    max-height: calc(100vh - 104px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
    flex-shrink: 0;
}

.lane-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    flex-shrink: 0;
}

.lane-header:active {
    cursor: grabbing;
}

.lane-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lane-title .done-badge {
    font-size: 12px;
    opacity: 0.6;
}

.lane-settings {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.lane-settings:hover {
    background: var(--border-color);
}

.lane-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
}

.lane-footer {
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.add-item-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.add-item-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.add-lane-btn {
    background: var(--bg-lane);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    width: 60px;
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
    transition: all 0.3s;
    flex-shrink: 0;
    align-self: flex-start;
}

.add-lane-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==================== ITEMS ==================== */
.item {
    background: var(--bg-item);
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: grab;
    transition: all 0.3s;
    overflow: hidden;
    flex-shrink: 0;
    user-select: none;
}

.item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.item:active {
    cursor: grabbing;
}

.item.dragging {
    opacity: 0.4;
    transform: rotate(2deg);
}

.item-theme-bar {
    height: 6px;
    background: var(--border-color);
}

.item-content {
    padding: 12px;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.item-theme-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
    white-space: nowrap;
}

.item-title {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
    margin-bottom: 6px;
}

.item-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-due-date {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.item-due-date.overdue {
    color: var(--danger);
    font-weight: 500;
}

.item-due-date.due-soon {
    color: #f39c12;
    font-weight: 500;
}

.item.dimmed {
    opacity: 0.4;
}

.item.highlighted {
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-hover);
}

.item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== DRAG & DROP ==================== */
.lane.drag-over .lane-items {
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
}

.drop-zone-active {
    min-height: 100px;
}

.lane-items {
    transition: background 0.2s ease;
}

.drop-indicator {
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin: 5px 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lane.dragging {
    opacity: 0.5;
    transform: rotate(1deg);
}

.lane.lane-drag-over {
    border: 2px dashed var(--accent);
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-lane);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-content.modal-sm {
    max-width: 400px;
}

.modal-content.modal-lg {
    max-width: 700px;
}

.modal-theme-bar {
    height: 8px;
    background: var(--border-color);
    flex-shrink: 0;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.modal-footer-right {
    display: flex;
    gap: 10px;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-item);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--text-secondary);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

/* ==================== THEMES LIST ==================== */
.themes-list {
    margin-bottom: 20px;
}

.theme-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.theme-item:last-child {
    border-bottom: none;
}

.theme-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}

.theme-name {
    flex: 1;
    font-size: 14px;
}

.theme-name input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-item);
    color: var(--text-primary);
    font-size: 14px;
}

.theme-actions {
    display: flex;
    gap: 5px;
}

.theme-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.theme-actions button:hover {
    opacity: 1;
}

.add-theme-form h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.theme-form-row {
    display: flex;
    gap: 10px;
}

.theme-form-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-item);
    color: var(--text-primary);
}

.theme-form-row input[type="color"] {
    width: 40px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

/* ==================== ARCHIVE ==================== */
.archive-search {
    margin-bottom: 20px;
}

.archive-search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-item);
    color: var(--text-primary);
    font-size: 14px;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.archive-item {
    background: var(--bg-item);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.archive-item-theme {
    height: 4px;
}

.archive-item-content {
    padding: 15px;
}

.archive-item-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.archive-item-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.archive-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 10px;
}

.archive-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal.active .modal-content {
    animation: slideIn 0.3s ease;
}

.item {
    animation: fadeIn 0.3s ease;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-center {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .logo {
        font-size: 16px;
    }

    .board-container {
        padding: 10px;
        justify-content: flex-start;
    }

    .board {
        justify-content: flex-start;
    }

    .lane {
        width: 280px;
        min-width: 280px;
    }

    .modal-content {
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .header-left .logo {
        font-size: 14px;
    }

    .header-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Board layout voor mobile */
    .board-container {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .board {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .lane {
        width: 100%;
        min-width: 100%;
        max-height: 60vh;
    }

    /* Add lane button - compact op mobile */
    .add-lane-btn {
        width: 100%;
        height: 50px;
        border-radius: 8px;
        flex-direction: row;
        font-size: 16px;
    }

    .add-lane-btn span {
        margin-right: 8px;
    }

    .add-lane-btn::after {
        content: 'Nieuwe lane';
        font-size: 14px;
        font-weight: 500;
    }

    /* Form row stacked op mobile */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Items iets compacter */
    .item-content {
        padding: 10px;
    }

    .item-title {
        font-size: 13px;
    }

    .item-description {
        font-size: 11px;
    }

    /* Lane header */
    .lane-header {
        padding: 12px;
    }

    .lane-title {
        font-size: 14px;
    }

    /* Modal fullscreen op mobile */
    .modal {
        padding: 0;
    }

    .modal-content {
        border-radius: 0;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
    }

    .modal-content.modal-sm,
    .modal-content.modal-lg {
        max-width: 100%;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .header {
        padding: 10px;
    }

    .header-left .logo {
        font-size: 12px;
    }

    .header-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .header-right {
        gap: 4px;
    }

    .lane-header {
        padding: 10px;
    }

    .lane-title {
        font-size: 13px;
    }

    .add-item-btn {
        padding: 8px;
        font-size: 13px;
    }
}