/* Modern Eisenhower Matrix inspired by shadcn-ui */
/* Import shared design system */
@import url('../shared-design-system.css');

/* Eisenhower-specific overrides and additions */
:root {
    /* Extremely subtle quadrant colors - barely noticeable */
    --urgent-important: #fefefe;
    --urgent-important-border: #f8f8f8;
    --important: #fefefe;
    --important-border: #f8f8f8;
    --urgent: #fefefe;
    --urgent-border: #f8f8f8;
    --neither: #fefefe;
    --neither-border: #f8f8f8;
}

body.dark {
    --urgent-important: #2a2a2a;
    --urgent-important-border: #3a3a3a;
    --important: #2a2a2a;
    --important-border: #3a3a3a;
    --urgent: #2a2a2a;
    --urgent-border: #3a3a3a;
    --neither: #2a2a2a;
    --neither-border: #3a3a3a;
}

/* Eisenhower-specific body styles - inherits from shared design system */
body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.container {
    width: 100vw;
    height: 100vh;
    padding: 1rem;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

/* Header styles inherited from shared design system */

h1 {
    margin: 0;
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.subtitle {
    color: var(--muted-foreground);
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 400;
}

.matrix-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    flex: 1;  /* Take all available space */
    height: 100%;
}

.quadrant {
    /* Card component styles inspired by shadcn-ui */
    background: var(--entry);
    color: var(--primary);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0;
    box-shadow: none;
    transition: all 0.2s ease;
    overflow: hidden;
}

.quadrant:hover {
    box-shadow: var(--shadow-xs);
    transform: none;
}

.quadrant[data-quadrant="urgent-important"] { 
    background: #ffffff;
    border: 1px solid var(--border);
}
.quadrant[data-quadrant="important"] { 
    background: #ffffff;
    border: 1px solid var(--border);
}
.quadrant[data-quadrant="urgent"] { 
    background: #ffffff;
    border: 1px solid var(--border);
}
.quadrant[data-quadrant="neither"] { 
    background: #ffffff;
    border: 1px solid var(--border);
}

/* Dark mode quadrant styles */
body.dark .quadrant[data-quadrant="urgent-important"] { 
    background: #2e2e33;
    border: 1px solid var(--border);
}
body.dark .quadrant[data-quadrant="important"] { 
    background: #2e2e33;
    border: 1px solid var(--border);
}
body.dark .quadrant[data-quadrant="urgent"] { 
    background: #2e2e33;
    border: 1px solid var(--border);
}
body.dark .quadrant[data-quadrant="neither"] { 
    background: #2e2e33;
    border: 1px solid var(--border);
}

.quadrant-header {
    /* Card header styles inspired by shadcn-ui */
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 0.375rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.quadrant-info {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.add-task-btn {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
}

.quadrant-title {
    /* Card title styles inspired by shadcn-ui */
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.005em;
}

/* Colored quadrant titles */
.quadrant[data-quadrant="urgent-important"] .quadrant-title {
    color: #dc2626;  /* Red for highest priority */
}
.quadrant[data-quadrant="important"] .quadrant-title {
    color: #f59e0b;  /* Orange/Yellow for important but not urgent */
}
.quadrant[data-quadrant="urgent"] .quadrant-title {
    color: #3b82f6;  /* Blue for urgent but not important */
}
.quadrant[data-quadrant="neither"] .quadrant-title {
    color: #10b981;  /* Green for lowest priority */
}

.quadrant-subtitle {
    /* Subtitle for action guidance */
    margin: 0.375rem 0 0 0;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--muted-foreground);
    line-height: 1.3;
}

.task-count {
    /* Card description styles inspired by shadcn-ui */
    font-size: 0.875rem;
    color: var(--muted-foreground);
    font-weight: 400;
}

.add-task-btn {
    /* Button component styles inspired by shadcn-ui */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    
    /* Button variant: outline */
    border: 1px solid var(--border);
    background: var(--entry);
    color: var(--secondary);
    box-shadow: var(--shadow-xs);
    
    /* Size: icon */
    width: 2rem;
    height: 2rem;
    padding: 0;
    
    cursor: pointer;
}

.add-task-btn:hover {
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.add-task-btn:focus-visible {
    outline: 2px solid rgb(59 130 246 / 0.6);
    outline-offset: 2px;
    border-color: rgb(59 130 246);
}

.add-task-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.task-list {
    /* Card content styles inspired by shadcn-ui */
    flex: 1;
    padding: 0.75rem 1rem 1rem 1rem;  /* Reduced padding for more space */
    overflow-y: auto;
    max-height: calc(100% - 60px);  /* Fixed max height with scrolling, accounting for smaller header */
    min-height: 0;  /* Allow flex to shrink */
    display: flex;
    flex-direction: column;  /* Enable order property for completed tasks */
}

.empty-state {
    text-align: center;
    color: var(--muted-foreground);
    margin-top: 1.5rem;  /* Reduced from 3rem to 1.5rem */
    font-size: 0.875rem;
    font-weight: 400;
}

.task-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border: none;
    transition: opacity 0.15s ease;
    margin-bottom: 0.25rem;
}

.task-item:last-child {
    margin-bottom: 0;
}

.task-item.completed {
    opacity: 0.5;
    order: 999;  /* Move completed tasks to bottom */
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--muted-foreground);
}

.task-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    margin-top: 0.125rem;
    cursor: pointer;
    background: #fff;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.task-checkbox.checked {
    background: var(--text);
    border-color: var(--text);
    position: relative;
}

.task-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-text {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.3;
    color: var(--primary);
    word-break: break-word;
}

.task-notes {
    margin-top: 0.125rem;
    color: var(--muted-foreground);
    font-size: 0.7rem;
    line-height: 1.2;
}


.task-actions {
    display: flex;
    gap: 0.125rem;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.task-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 0.125rem;
    border-radius: 3px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-action:hover {
    color: var(--primary);
    background: var(--accent);
}

/* Drag & drop styles */
.task-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
}

.task-list.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
    border: 2px dashed rgb(59, 130, 246);
    border-radius: 8px;
}

.task-completing {
    animation: taskComplete 0.3s ease;
}

@keyframes taskComplete {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.drop-zone {
    min-height: 60px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    margin-top: .5rem;
}

/* Dialog/Modal styles inspired by shadcn-ui */
.modal {
    /* Dialog content styles */
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 50;
    display: grid;
    width: 100%;
    max-width: calc(100% - 2rem);
    translate: -50% -50%;
    gap: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--entry);
    color: var(--primary);
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    duration: 200ms;
}

@media (min-width: 640px) {
    .modal {
        max-width: 32rem;
    }
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    /* Dialog overlay styles */
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgb(0 0 0 / 0.5);
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.modal-backdrop.hidden {
    display: none;
}

.modal-header {
    /* Dialog header styles */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .modal-header {
        text-align: left;
    }
}

.modal-header h3 {
    /* Dialog title styles */
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1;
}

.modal-close {
    /* Dialog close button */
    position: absolute;
    top: 1rem;
    right: 1rem;
    border-radius: 2px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--muted-foreground);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    opacity: 1;
    background: var(--accent);
    color: var(--accent-foreground);
}

.modal-close:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.modal-body {
    /* Dialog content area */
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    /* Form label styles */
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    line-height: 1;
}

.input-group input,
.input-group textarea,
.input-group select {
    /* Input component styles inspired by shadcn-ui */
    display: flex;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--entry);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--primary);
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.25;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: 2px solid rgb(59 130 246 / 0.2);
    outline-offset: 2px;
    border-color: var(--primary);
}

.input-group textarea {
    min-height: 2.5rem;
    resize: vertical;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--muted-foreground);
}

.input-group input:disabled,
.input-group textarea:disabled,
.input-group select:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.modal-actions {
    /* Dialog footer styles */
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .modal-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
}

.btn {
    /* Button component base styles inspired by shadcn-ui */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
    
    /* Default size */
    height: 2.25rem;
    padding: 0.5rem 1rem;
    min-width: 80px;
    
    /* Default variant */
    background: var(--primary);
    color: var(--entry);
    border: 1px solid var(--primary);
    box-shadow: var(--shadow-xs);
}

.btn:hover {
    background: rgb(51 65 85 / 0.9);
    box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
    outline: 2px solid rgb(59 130 246 / 0.6);
    outline-offset: 2px;
    border-color: rgb(59 130 246);
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn-primary {
    /* Default variant - already styled above */
}

.btn-secondary {
    /* Secondary variant */
    background: var(--secondary);
    color: var(--entry);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: rgb(100 116 139 / 0.8);
}

.btn-outline {
    /* Outline variant */
    border: 1px solid var(--border);
    background: var(--entry);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.btn-danger {
    /* Destructive variant */
    background: var(--destructive);
    color: var(--destructive-foreground);
    border-color: var(--destructive);
    box-shadow: var(--shadow-xs);
}

.btn-danger:hover {
    background: rgb(239 68 68 / 0.9);
}

.btn-danger:focus-visible {
    outline: 2px solid rgb(239 68 68 / 0.4);
    outline-offset: 2px;
    border-color: var(--destructive);
}

/* Backdrop styles already defined above */

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }
    
    .matrix-container {
        gap: 0.75rem;
    }
    
    .quadrant {
        border-radius: 8px;
    }
    
    .quadrant-header {
        padding: 0.75rem;
    }
    
    .quadrant-title {
        font-size: 0.8125rem;
    }
    
    .task-list {
        padding: 0.5rem 0.75rem 0.75rem 0.75rem;
    }
    
    .task-item {
        padding: 0.75rem 0;
        gap: 0.625rem;
    }
    
    .modal {
        width: 95%;
        max-width: none;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1.25rem 1.25rem 0;
    }
    
    .modal-body {
        padding: 0 1.25rem;
    }
    
    .modal-actions {
        padding: 1.25rem;
        flex-direction: column-reverse;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .matrix-container {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .quadrant {
        min-height: 120px;
    }
    
    .quadrant-header {
        padding: 0.5rem;
    }
    
    .task-list {
        padding: 0.25rem 0.5rem 0.5rem 0.5rem;
        max-height: calc(100% - 50px);
    }
}

/* Full viewport layout - no theme toggle needed */
