:root {
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-bg-inner: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-border-light: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08), 0 4px 16px 0 rgba(0, 0, 0, 0.04);
    --glass-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.9), inset 0 0 20px rgba(255, 255, 255, 0.3);
    --blur: blur(40px) saturate(180%);
    
    --overlay-bg: rgba(255, 255, 255, 0.3);
    
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #007AFF;
    --accent-hover: #0056b3;
    
    --blob-1: #ffb3ba;
    --blob-2: #baffc9;
    --blob-3: #bae1ff;
}

body.dark-mode {
    --glass-bg: rgba(30, 30, 32, 0.65);
    --glass-bg-inner: rgba(40, 40, 42, 0.45);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-border-light: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.5), 0 8px 16px 0 rgba(0, 0, 0, 0.3);
    --glass-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.05);
    
    --overlay-bg: rgba(0, 0, 0, 0.6);
    
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    
    --blob-1: #4a0e4e;
    --blob-2: #16213e;
    --blob-3: #0f3460;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    transition: background-color 0.5s ease;
}

/* Dynamic Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #0f0f0f;
}

body:not(.dark-mode) .background-mesh {
    background: #f0f0f0;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.8;
    animation: move 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 { width: 50vw; height: 50vw; background: var(--blob-1); top: -10%; left: -10%; }
.blob-2 { width: 60vw; height: 60vw; background: var(--blob-2); bottom: -20%; right: -10%; animation-delay: -5s; }
.blob-3 { width: 40vw; height: 40vw; background: var(--blob-3); top: 30%; left: 40%; animation-delay: -10s; }

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
    border-radius: 24px;
}

.glass-panel-inner {
    background: var(--glass-bg-inner);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-highlight);
    border-radius: 16px;
}

/* Layout */
.app-container {
    width: 95vw;
    height: 90vh;
    max-width: 1400px;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    border-right: 1px solid var(--glass-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    background: linear-gradient(135deg, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body:not(.dark-mode) .brand {
    background: linear-gradient(135deg, #000, #4a4a4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.nav-links li:hover {
    background: var(--glass-bg-inner);
    color: var(--text-primary);
}

.nav-links li.active {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.main-content {
    flex-grow: 1;
    padding: 32px 48px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Buttons & Inputs */
.glass-btn {
    background: var(--glass-bg-inner);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.glass-btn:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border-light);
    transform: translateY(-1px);
}

.glass-btn.primary {
    background: rgba(0, 122, 255, 0.2);
    border-color: rgba(0, 122, 255, 0.4);
    color: #4da3ff;
}

body:not(.dark-mode) .glass-btn.primary {
    background: rgba(0, 122, 255, 0.8);
    color: white;
}

.icon-btn {
    padding: 10px;
    border-radius: 50%;
}

.quick-add {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    margin-bottom: 32px;
}

.quick-add input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    outline: none;
}

.quick-add input::placeholder {
    color: var(--text-secondary);
}

.glass-input {
    width: 100%;
    background: var(--glass-bg-inner);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
    margin: 16px 0;
}

/* Views Container */
.view-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 16px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Task List */
.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    transition: all 0.2s ease;
}

.task-item:hover {
    transform: translateX(4px);
    background: var(--glass-bg);
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--glass-border-light);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.task-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
}

.task-checkbox.checked::after {
    content: '';
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.task-content {
    flex-grow: 1;
}

.task-title {
    font-size: 16px;
    font-weight: 500;
}

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

.task-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

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

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 24px;
    height: 100%;
}

.kanban-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.kanban-column h3 {
    margin-bottom: 16px;
    font-size: 18px;
    color: var(--text-secondary);
}

.kanban-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-task {
    padding: 12px;
    cursor: grab;
}

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

/* Eisenhower Matrix */
.eisenhower-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 24px;
    height: 100%;
    min-height: 500px;
}

.matrix-quadrant {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.matrix-quadrant h3 {
    margin-bottom: 16px;
    font-size: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.q-do h3 { color: #ff6b6b; }
.q-decide h3 { color: #4dabf7; }
.q-delegate h3 { color: #fcc419; }
.q-delete h3 { color: #868e96; }

/* Pomodoro */
.pomodoro-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
}

.timer-display {
    font-size: 120px;
    font-weight: 700;
    letter-spacing: -4px;
    background: linear-gradient(135deg, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 32px;
}

body:not(.dark-mode) .timer-display {
    background: linear-gradient(135deg, #000, #4a4a4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.timer-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.focus-task-label {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.modal {
    width: 500px;
    padding: 32px;
}

.modal h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.hidden {
    display: none !important;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Phone & Mobile Optimization */
@media (max-width: 768px) {
    body {
        align-items: stretch;
        overflow: hidden;
    }
    .app-container {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
        flex-direction: column;
        border: none;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 8px 12px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        order: 2;
        justify-content: space-between;
        align-items: center;
        border-radius: 0;
    }
    .brand {
        display: none;
    }
    .nav-links {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        width: calc(100% - 60px);
        margin: 0;
    }
    .nav-links li {
        flex: 1;
        margin-bottom: 0;
        padding: 8px 4px;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        font-size: 10px;
        align-items: center;
        border-radius: 8px;
    }
    .nav-links li i {
        font-size: 18px;
    }
    .sidebar-bottom {
        width: 50px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .sidebar-bottom .glass-btn {
        padding: 8px;
    }
    .main-content {
        padding: 16px;
        height: calc(100vh - 68px);
        order: 1;
        overflow: hidden;
    }
    .topbar {
        margin-bottom: 16px;
    }
    h1 {
        font-size: 24px;
    }
    .quick-add {
        padding: 12px 16px;
        margin-bottom: 16px;
        gap: 8px;
        border-radius: 12px;
    }
    .quick-add input {
        font-size: 14px;
    }
    .view-container {
        padding-right: 0;
    }
    .kanban-board {
        flex-direction: column;
        overflow-y: auto;
        gap: 16px;
    }
    .kanban-column {
        min-height: 200px;
        padding: 12px;
    }
    .eisenhower-matrix {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 16px;
        min-height: auto;
        overflow-y: auto;
    }
    .matrix-quadrant {
        padding: 16px;
        min-height: 150px;
    }
    .pomodoro-container {
        min-height: auto;
        padding: 24px 16px;
    }
    .timer-display {
        font-size: 72px;
        margin-bottom: 16px;
    }
    .focus-task-label {
        font-size: 15px;
        text-align: center;
    }
    .modal {
        width: 90vw;
        padding: 20px;
        border-radius: 16px;
    }
    .task-actions {
        opacity: 1;
    }
}

