@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Base Variables - Light Mode Default (Ultra Modern) */
    --color-primary: #ef2020;
    --color-primary-hover: #d11a1a;
    --color-on-primary: #FFFFFF;
    --color-accent: #10B981; /* Success Green */
    --color-accent-soft: rgba(16, 185, 129, 0.1);
    
    --color-background: #F9FAFB;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F3F4F6;
    
    --color-foreground: #111827;
    --color-muted: #6B7280;
    
    --color-border: #E5E7EB;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.06);
    --blur-glass: blur(16px);
    
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
    /* Dark Mode (OLED-friendly, Cinematic) */
    --color-primary: #ef2020;
    --color-primary-hover: #ff4d4d;
    --color-on-primary: #FFFFFF;
    
    --color-background: #000000;
    --color-surface: #111111;
    --color-surface-hover: #1A1A1A;
    
    --color-foreground: #F9FAFB;
    --color-muted: #9CA3AF;
    
    --color-border: #27272A;
    
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-background);
    color: var(--color-foreground);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Shell Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    background: var(--color-background);
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    background: color-mix(in srgb, var(--color-background) 85%, transparent);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--color-border);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.greeting {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 500;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-foreground);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
    background: var(--color-surface-hover);
    transform: scale(1.05);
}

/* Date Strip (Weekly) */
.date-strip {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.date-strip::-webkit-scrollbar { display: none; }

.date-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 72px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.date-pill .day {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.date-pill .date {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-foreground);
    letter-spacing: -0.03em;
}

.date-pill.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: 0 8px 16px color-mix(in srgb, var(--color-primary) 25%, transparent);
    transform: translateY(-2px);
}

.date-pill.active .date {
    color: var(--color-on-primary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-muted);
}

/* Ultra Modern Task Card */
.task-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    gap: 16px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glass);
    border-color: color-mix(in srgb, var(--color-border) 80%, var(--color-primary));
}

.task-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 65px;
    padding-right: 16px;
    border-right: 1px dashed var(--color-border);
}

.task-time .start {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-foreground);
    letter-spacing: -0.02em;
}

.task-time .end {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 500;
    margin-top: 4px;
}

.task-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 500;
}

.task-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-card.status-done {
    opacity: 0.7;
    background: color-mix(in srgb, var(--color-surface) 95%, var(--color-accent));
}
.task-card.status-done:hover {
    opacity: 1;
}

.status-badge {
    color: var(--color-accent);
    background: var(--color-accent-soft);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 76px;
    background: color-mix(in srgb, var(--color-background) 85%, transparent);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 50;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    width: 64px;
    height: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transition: transform 0.2s;
}

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

.nav-item.active svg {
    transform: translateY(-2px);
}

.nav-item:hover:not(.active) {
    color: var(--color-foreground);
}

/* Form Elements */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-foreground);
}
.input-group input {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-foreground);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}
.input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 25%, transparent);
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.btn-outline {
    background: transparent;
    color: var(--color-foreground);
    border: 1px solid var(--color-border);
}

/* Page Header (with back button) */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--color-background) 85%, transparent);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    z-index: 40;
    border-bottom: 1px solid var(--color-border);
}
.back-btn {
    background: transparent;
    border: none;
    color: var(--color-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    margin-right: -8px; /* Optical alignment */
    transition: background 0.2s;
}
.back-btn:hover {
    background: var(--color-surface);
}
.page-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* List Items (Notifications/Settings) */
.list-view {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.list-item {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--color-foreground);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}
.list-item:last-child {
    border-bottom: none;
}
.list-item:hover {
    background: var(--color-surface-hover);
}
.list-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.list-content {
    flex: 1;
}
.list-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}
.list-desc {
    font-size: 13px;
    color: var(--color-muted);
}

/* Task Detail Specific */
.task-detail-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--color-border);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}
.task-detail-card h3 {
    font-size: 14px;
    color: var(--color-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}
