:root {
    --bg-color: #f1f5f9;
    --surface-color: #ffffff;
    --primary-color: #64748b;
    --primary-light: #94a3b8;
    --accent-color: #10b981;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --item-bg-completed: #f0fdf4;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.top-bar {
    padding: 1rem 1.5rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.top-bar h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Main Content */
.main-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    padding-bottom: calc(5rem + var(--safe-area-bottom));
}

/* Todo UI - Reference Style */
.todo-container {
    background: var(--surface-color);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.todo-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.todo-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.todo-header-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.todo-header-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filter-chips {
    display: flex;
    gap: 0.5rem;
}

.filter-chip {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
}

.todo-input-row {
    margin-top: 1rem;
}

.todo-input-row input {
    width: 100%;
    border: none;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    background: transparent;
}

.todo-input-row input::placeholder {
    color: #cbd5e1;
}

/* Todo List */
.todo-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.todo-item:last-child {
    border-bottom: none;
}

.todo-item.completed {
    background-color: var(--item-bg-completed);
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.todo-item.completed .custom-checkbox {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.custom-checkbox lucide-icon {
    display: none;
}

.todo-item.completed .custom-checkbox i {
    color: white;
    width: 14px;
    height: 14px;
}

.todo-text {
    font-size: 1.05rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Calendar Section - Light Mode */
.calendar-view {
    background: var(--surface-color);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 1rem;
}

.day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
}

.day-cell.today {
    background: var(--primary-color);
    color: white;
}

/* Bottom Nav - Light Mode */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(4rem + var(--safe-area-bottom));
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-area-bottom);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item i {
    width: 22px;
    height: 22px;
    margin-bottom: 4px;
}

.hidden { display: none !important; }

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-content {
    background: var(--surface-color);
    width: 100%;
    max-width: 450px;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-btn {
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn i {
    width: 20px;
    height: 20px;
}

#event-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    background: #f8fafc;
}

.form-group input:focus {
    border-color: var(--primary-light);
}

.priority-chips {
    display: flex;
    gap: 0.5rem;
}

.priority-chip {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    background: #f1f5f9;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.priority-chip.low.active { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.priority-chip.medium.active { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.priority-chip.high.active { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.submit-btn {
    margin-top: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.85rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: filter 0.2s;
}

.submit-btn:active {
    filter: brightness(0.9);
}

/* Event List Styling */
.event-item {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.event-item.high { border-left-color: #ef4444; }
.event-item.medium { border-left-color: #f59e0b; }
.event-item.low { border-left-color: #10b981; }

.event-item-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.event-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    align-items: center;
}
