:root {
    --q1-color: #AEE7B1;
    --q2-color: #ABBEE1;
    --q3-color: #BCB5F0;
    --q4-color: #F5D26C;
    --q1-label: 'Do This';
    --q2-label: 'Schedule This';
    --q3-label: 'Delegate This';
    --q4-label: 'Consider This';
}

/* Dark Theme (Default) */
body {
    --bg-dark: #0f0f1e;
    --bg-darker: #0a0a15;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --border-color: #2a2a40;
    --accent: #6c63ff;
}

/* Light Theme */
body.light-theme {
    --bg-dark: #f5f5f7;
    --bg-darker: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a6e;
    --border-color: #d0d0e0;
    --accent: #5a52d5;
}

body.light-theme .header {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light-theme .quadrant {
    background: rgba(0, 0, 0, 0.02);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .task-item {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.light-theme .task-item:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-theme .modal {
    background: rgba(0, 0, 0, 0.5);
}

body.light-theme .btn {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .list-section {
    background: rgba(0, 0, 0, 0.02);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .list-item-row {
    background: rgba(255, 255, 255, 0.8);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--bg-darker) 0%, #1a1a2e 100%);
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a0a0b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #5a52d5 100%);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7b73ff 0%, var(--accent) 100%);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Matrix Container */
.container {
    padding: 1rem;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    height: 100%;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Quadrant */
.quadrant {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.quadrant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0.6;
}

.quadrant-1::before { background: var(--q1-color); }
.quadrant-2::before { background: var(--q2-color); }
.quadrant-3::before { background: var(--q3-color); }
.quadrant-4::before { background: var(--q4-color); }

.quadrant.drag-over {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: scale(1.02);
}

.quadrant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.quadrant-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quadrant-label {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quadrant-1 .quadrant-label { background: var(--q1-color); color: #0a0a15; }
.quadrant-2 .quadrant-label { background: var(--q2-color); color: #0a0a15; }
.quadrant-3 .quadrant-label { background: var(--q3-color); color: #0a0a15; }
.quadrant-4 .quadrant-label { background: var(--q4-color); color: #0a0a15; }

.quadrant-items {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 0.25rem;
}

/* Task Item */
.task-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-left: 3px solid;
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.task-item:active {
    cursor: grabbing;
}

.task-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.quadrant-1 .task-item { border-left-color: var(--q1-color); }
.quadrant-2 .task-item { border-left-color: var(--q2-color); }
.quadrant-3 .task-item { border-left-color: var(--q3-color); }
.quadrant-4 .task-item { border-left-color: var(--q4-color); }

.task-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    opacity: 0.5;
}

.task-meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.task-tag {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.task-due {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

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

.modal-content {
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-darker);
    flex-shrink: 0;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-darker);
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: all 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.checkbox-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

.checkbox-item label {
    margin: 0;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-primary);
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions .btn {
    flex: 1;
}

/* List View */
.list-view {
    display: none;
    animation: fadeIn 0.6s ease-out;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.list-view.active {
    display: block;
}

.list-section {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.list-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Color Picker */
.color-picker-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.color-picker-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-picker-group input[type="text"] {
    flex: 1;
}

/* List Items Management */
.list-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.list-item-color {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
}

.list-item-info {
    flex: 1;
}

.list-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.list-item-dates {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.delete-btn {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff3b30;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

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

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

/* Hidden file input */
#importFile {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .matrix {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, minmax(200px, 1fr));
    }

    .container {
        height: auto;
        overflow: visible;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-brand {
        width: 100%;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .logo {
        width: 32px;
        height: 32px;
    }

    .toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .container {
        padding: 0.75rem;
        height: auto;
    }

    .btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header, .modal-footer {
        padding: 1.25rem;
    }
}

/* Utility Classes for Previously Inline Styles */
.hidden {
    display: none;
}

.task-dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.date-field-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.readonly-input {
    background: rgba(255, 255, 255, 0.02);
    cursor: default;
}

.lists-section-spacing {
    margin-bottom: 2rem;
}

.lists-section-title {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.full-width-btn {
    margin-top: 1rem;
    width: 100%;
}

.small-icon {
    width: 16px;
    height: 16px;
}

.medium-icon {
    width: 18px;
    height: 18px;
}

.flex-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.flex-1 {
    flex: 1;
}

.q-label-input {
    margin-top: 0.5rem;
}
