:root {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-primary: #333;
    --text-secondary: #666;
    --accent-color: #764ba2;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --radius: 12px;

    /* Column Colors */
    --col-todo: #ff6b6b;
    --col-inprogress: #feca57;
    --col-done: #48dbfb;
}

body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    --glass-bg: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 255, 255, 0.05);
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #f0f0f0;
    --text-secondary: #aaa;
    --accent-color: #48dbfb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease;
    overflow-x: hidden;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.controls {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s;
    padding: 8px;
    border-radius: 50%;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.icon-btn.danger:hover {
    color: #ff6b6b;
}

/* Board */
.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    flex: 1;
    overflow-y: hidden;
    /* Scroll inside columns */
}

.column {
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    height: 100%;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.column h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-todo {
    background: var(--col-todo);
}

.status-inprogress {
    background: var(--col-inprogress);
}

.status-done {
    background: var(--col-done);
}

.count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.add-task-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

.add-task-btn:hover {
    background: var(--text-primary);
    color: var(--bg-gradient);
    /* Inverse color trick kinda */
}

/* Task List */
.task-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    padding-bottom: 20px;
    /* Space for drag */
}

/* Scrollbar */
.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* Card */
.task-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.task-card:active {
    cursor: grabbing;
}

.task-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.tag.design {
    background: #e0f2f1;
    color: #00695c;
}

.tag.dev {
    background: #e3f2fd;
    color: #1565c0;
}

.tag.marketing {
    background: #fce4ec;
    color: #ad1457;
}

.tag.other {
    background: #f5f5f5;
    color: #616161;
}

.task-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.task-card:hover .task-actions {
    opacity: 1;
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ff6b6b;
    font-size: 0.9rem;
}

.task-card h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.task-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.task-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--text-primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-group textarea {
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn.secondary {
    background: #f1f1f1;
    color: #333;
}

.btn.primary {
    background: var(--accent-color);
    color: white;
}

.btn.primary:hover {
    filter: brightness(1.1);
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .board {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 1fr);
        overflow-y: auto;
    }

    .column {
        min-width: auto;
        height: auto;
        min-height: 200px;
    }

    .app-container {
        height: auto;
    }
}