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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    gap: 16px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.install-btn {
    padding: 10px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Navigation */
.nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.nav-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
    border-radius: var(--radius);
    position: relative;
}

.nav-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    box-shadow: var(--shadow);
    transform: scale(1.05);
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    animation: fadeInUp 0.4s ease-out;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

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

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.section-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 16px;
}

/* Input Group */
.input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-bottom: 20px;
    align-items: end;
}

.input-group.full {
    grid-template-columns: 1fr;
}

.input-group.grid-3 {
    grid-template-columns: 2fr 1fr 1fr auto;
}

input, select {
    padding: 12px 16px;
    border: 2px solid var(--border);
    background: var(--bg);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    border-radius: var(--radius);
    color: var(--text-primary);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: linear-gradient(var(--bg), var(--bg)), linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

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

input[type="date"],
input[type="time"] {
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    padding: 12px 20px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-nav {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 8px 12px;
    transition: var(--transition);
    color: var(--text-secondary);
    border-radius: var(--radius);
}

.btn-nav:hover {
    background: var(--bg-secondary);
    color: var(--primary);
    transform: scale(1.1);
}

.btn-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--danger);
    padding: 8px 12px;
    transition: var(--transition);
    border-radius: var(--radius);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    transform: scale(1.2);
}

.btn-secondary {
    padding: 10px 16px;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 600;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Lists */
.list {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.list-item {
    padding: 16px;
    border: 2px solid var(--border);
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    gap: 12px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.list-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.list-item.completed {
    opacity: 0.6;
    text-decoration: line-through;
    background: var(--bg-secondary);
}

.list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.list-item-title {
    font-weight: 600;
    color: var(--text-primary);
}

.list-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.list-item-tag {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
}

.list-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.list-item-progress {
    flex: 0 0 auto;
    width: 60px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.list-item-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
    transition: width 0.3s ease;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Calendar */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.calendar-nav h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    min-width: 200px;
    text-align: center;
}

.calendar {
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
    border-radius: var(--radius);
    font-weight: 600;
    position: relative;
}

.calendar-day:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.calendar-day.other-month {
    color: var(--text-secondary);
    opacity: 0.4;
}

.calendar-day.today {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
}

.calendar-day.has-event {
    border-color: var(--accent);
    border-width: 2px;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* Checkbox */
.checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.category-badge.work {
    background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
}

.category-badge.personal {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.category-badge.health {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.category-badge.learning {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

/* Progress Ring */
.progress-ring {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header-actions {
        width: 100%;
    }

    .input-group {
        grid-template-columns: 1fr;
    }

    .input-group.grid-3 {
        grid-template-columns: 1fr;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-item-actions {
        align-self: flex-end;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        font-size: 11px;
    }

    .stat-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .header {
        padding: 12px;
    }

    .header h1 {
        font-size: 20px;
    }

    .nav {
        gap: 4px;
        padding: 4px;
    }

    .nav-btn {
        padding: 10px 12px;
    }

    .section-header h2 {
        font-size: 18px;
    }

    input {
        font-size: 16px;
    }

    .btn-primary {
        width: 100%;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --border: #475569;
    }

    .header {
        background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
    }

    .nav {
        background: var(--bg-secondary);
    }

    .nav-btn.active {
        background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    }

    input, select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border);
    }

    input:focus, select:focus {
        border-color: #7c3aed;
        box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    }

    .btn-primary {
        background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    }

    .list-item {
        background: var(--bg-secondary);
        border-color: var(--border);
    }

    .list-item:hover {
        border-color: #7c3aed;
    }

    .list-item.completed {
        background: var(--bg-tertiary);
    }

    .stat-card {
        background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
        border-color: var(--border);
    }

    .calendar {
        background: var(--bg-secondary);
        border-color: var(--border);
    }

    .calendar-day {
        background: var(--bg-secondary);
        border-color: var(--border);
    }

    .calendar-day:hover {
        background: var(--bg-tertiary);
    }

    .calendar-day.today {
        background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 24px;
}

.mb-4 {
    margin-bottom: 24px;
}

.hidden {
    display: none;
}
