:root {
    --background: 0 0% 100%;
    --foreground: 224 71.4% 4.1%;
    --card: 0 0% 100%;
    --card-foreground: 224 71.4% 4.1%;
    --popover: 0 0% 100%;
    --popover-foreground: 224 71.4% 4.1%;
    --primary: 220.9 39.3% 11%;
    --primary-foreground: 210 20% 98%;
    --secondary: 220 14.3% 95.9%;
    --secondary-foreground: 220.9 39.3% 11%;
    --muted: 220 14.3% 95.9%;
    --muted-foreground: 220 8.9% 46.1%;
    --accent: 220 14.3% 95.9%;
    --accent-foreground: 220.9 39.3% 11%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 20% 98%;
    --border: 220 13% 91%;
    --input: 220 13% 91%;
    --ring: 224 71.4% 4.1%;
    --radius: 0.5rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: 224 71.4% 4.1%;
        --foreground: 210 20% 98%;
        --card: 224 71.4% 4.1%;
        --card-foreground: 210 20% 98%;
        --popover: 224 71.4% 4.1%;
        --popover-foreground: 210 20% 98%;
        --primary: 210 20% 98%;
        --primary-foreground: 220.9 39.3% 11%;
        --secondary: 215 27.9% 16.9%;
        --secondary-foreground: 210 20% 98%;
        --muted: 215 27.9% 16.9%;
        --muted-foreground: 217.9 10.6% 64.9%;
        --accent: 215 27.9% 16.9%;
        --accent-foreground: 210 20% 98%;
        --destructive: 0 62.8% 30.6%;
        --destructive-foreground: 210 20% 98%;
        --border: 215 27.9% 16.9%;
        --input: 215 27.9% 16.9%;
        --ring: 216 12.2% 83.9%;
    }
}

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

html {
    /* Support for iOS safe area */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    
    /* Prevent overscroll and bounce effect */
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    width: 100%;
    height: 100%;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    position: fixed;
    touch-action: none; /* Disable all touch gestures except in scrollable areas */
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(to bottom, hsl(var(--background)), hsl(var(--muted) / 0.3));
    overflow: hidden;
    position: relative;
}

.todo-app {
    width: 100%;
    max-width: 540px;
    background: hsl(var(--card));
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    padding: 2rem 2rem 1.5rem;
    padding-top: calc(2rem + env(safe-area-inset-top));
    text-align: center;
    border-bottom: 1px solid hsl(var(--border));
    background: linear-gradient(to bottom, hsl(var(--card)), hsl(var(--muted) / 0.2));
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.title {
    font-size: 1.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

@media (max-width: 640px) {
    .container {
        padding: 0;
        align-items: flex-start;
        height: 100vh;
        overflow: hidden;
    }
    
    .todo-app {
        border-radius: 0;
        max-width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
        display: flex;
        flex-direction: column;
    }
    
    .header {
        padding: 1.5rem 1.5rem 1rem;
        padding-top: calc(1.5rem + env(safe-area-inset-top));
    }
    
    .title {
        font-size: 1.5rem;
    }
}