/* style.css */
:root {
    --primary: #ff3b30;
    --secondary: #d92d22;
    --text: #1d1d1f;
    --bg: #f5f5f7;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: var(--text);
    padding-bottom: 80px; /* Space for bottom nav */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.app-header {
    position: fixed; top: 0; left: 0; width: 100%;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}
.app-header h1 { 
    margin: 0; 
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #ff4d4d;
        --secondary: #ff3b30;
        --text: #f5f5f7;
        --bg: #000000;
        --white: #1c1c1e;
        --glass: rgba(28, 28, 30, 0.65);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    }
    
    .app-header,
    .bottom-nav {
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .input-container input,
    .input-container select {
        border-color: rgba(255, 255, 255, 0.2);
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--text);
    }
    
    .filter-btn {
        border-color: rgba(255, 255, 255, 0.2);
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--text);
    }
    
    .filter-btn.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }
    
    .secondary-btn {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .text-btn {
        color: #a0a0a0;
    }
    
    .text-btn:hover {
        color: var(--primary);
    }
    
    .todo-item, .grocery-item {
        background: rgba(28, 28, 30, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .welcome-card {
        background: rgba(28, 28, 30, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .action-btn {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: var(--text);
    }
    
    .action-btn:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: var(--text);
    padding-bottom: 80px; /* Space for bottom nav */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.app-header {
    position: fixed; top: 0; left: 0; width: 100%;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}
.app-header h1 { 
    margin: 0; 
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* Content */
.app-content {
    max-width: 600px; margin: 80px auto 0;
    padding: 20px; min-height: 80vh;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed; bottom: 0; width: 100%; background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex; justify-content: space-around; padding: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 100;
    border-top: 1px solid var(--glass-border);
}
.nav-btn {
    background: none; border: none; text-align: center;
    color: #8e8e93; cursor: pointer; display: flex; flex-direction: column; align-items: center;
}
.nav-btn span { font-size: 0.75rem; margin-top: 5px; font-weight: 500; }
.nav-btn.active { color: var(--primary); }
.nav-btn i { font-size: 1.5rem; }

/* Views */
.view-content { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Cards & Inputs */
.welcome-card { 
    background: var(--glass); 
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 30px; 
    border-radius: 24px; 
    text-align: center; 
    margin-bottom: 30px; 
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
}
.quick-stats { display: flex; justify-content: space-around; margin-top: 20px; }
.stat h3 { color: var(--primary); font-size: 2.5rem; margin: 0; font-weight: 700; }
.stat small { color: #8e8e93; font-size: 0.85rem; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.action-btn { 
    background: var(--glass); 
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border); 
    padding: 15px; 
    border-radius: 18px; 
    cursor: pointer; 
    color: var(--text); 
    font-weight: 600; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 10px; 
    transition: all 0.3s ease;
}
.action-btn:hover { 
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.action-btn:active { transform: translateY(0); }
.action-btn i { color: var(--primary); }

.input-container { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 15px;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
}
input, select { 
    padding: 12px 15px; 
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text);
    font-size: 1rem;
    flex: 1;
    min-width: 120px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
}
input::placeholder { color: #a0a0a0; }
.primary-btn { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 12px 24px; 
    border-radius: 12px; 
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}
.primary-btn:hover { 
    background: var(--secondary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 59, 48, 0.4);
}
.primary-btn:active { transform: translateY(0); }

.secondary-btn { 
    background: var(--glass); 
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #8e8e93; 
    border: 1px solid var(--glass-border);
    padding: 8px 15px; 
    border-radius: 12px; 
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.secondary-btn:hover { 
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
}
.secondary-btn:active { transform: translateY(0); }

.filter-bar { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    overflow-x: auto;
    padding-bottom: 5px;
}
.filter-btn { 
    padding: 8px 16px; 
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px; 
    cursor: pointer; 
    white-space: nowrap;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: #8e8e93;
}
.filter-btn.active { 
    background: var(--primary); 
    color: white; 
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}
.filter-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Lists */
.item-list { list-style: none; padding: 0; }
.todo-item, .grocery-item { 
    display: flex; 
    align-items: center; 
    padding: 15px; 
    background: var(--glass); 
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    margin-bottom: 10px; 
    border-radius: 16px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}
.todo-item:hover, .grocery-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.todo-item.completed .text, .grocery-item.completed .name { 
    text-decoration: line-through; 
    color: #a0a0a0;
}
.info { margin-left: 15px; flex-grow: 1; }
.meta { display: flex; gap: 10px; font-size: 0.9rem; color: #8e8e93; margin-top: 5px; }
.badge-green { background: rgba(34, 197, 94, 0.15); color: #22c55e; padding: 4px 10px; border-radius: 12px; font-weight: 600; }
.badge-orange { background: rgba(251, 146, 60, 0.15); color: #fb923c; padding: 4px 10px; border-radius: 12px; font-weight: 600; }
.badge-grey { background: rgba(156, 163, 175, 0.15); color: #6b7280; padding: 4px 10px; border-radius: 12px; font-weight: 600; }
.delete-btn { background: none; border: none; color: #a0a0a0; cursor: pointer; font-size: 1.2rem; margin-left: 10px; transition: color 0.3s; }
.delete-btn:hover { color: var(--primary); }
.list-footer { display: flex; justify-content: space-between; margin-top: 20px; border-top: 1px solid var(--glass-border); padding-top: 15px; color: #8e8e93; }
.text-btn { background: none; border: none; color: #8e8e93; cursor: pointer; text-decoration: underline; }
.text-btn:hover { color: var(--primary); }