:root {
    --bg-color: #1a1a2e;
    --accent-color: #4ade80;
    --accent-glow: rgba(74, 222, 128, 0.3);
    --glass-bg: rgba(30, 30, 50, 0.7);
    /* Slightly more opaque for better readability */
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight on mobile */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
}

/* Header */
header {
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 0 16px 16px;
    /* Rounded bottom */
    border-top: none;
    border-left: none;
    border-right: none;
}

header .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

header .header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    overflow-x: auto;
    /* Scrollable if too many items */
    padding-bottom: 4px;
    /* Space for scrollbar if visible */
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Inputs */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

input[type="text"],
input[type="password"] {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 14px 16px;
    /* Larger tap area */
    border-radius: 12px;
    color: white;
    outline: none;
    transition: var(--transition-smooth);
    font-size: 16px;
    /* Prevent zoom on mobile */
}

input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Select */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Buttons */
button {
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 14px 20px;
    /* Touch friendly */
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    min-height: 48px;
    /* Standard touch target size */
}

button:active {
    transform: scale(0.96);
}

button.secondary {
    background: var(--glass-bg);
    color: white;
    border: 1px solid var(--glass-border);
}

/* Lists */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 100px;
    /* Space for scroll */
}

.list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    justify-content: space-between;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.list-item:active {
    background: rgba(40, 40, 70, 0.8);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-item .content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    overflow: hidden;
    /* Prevent text overflow */
}

.text {
    word-break: break-word;
}

.list-item.completed .text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.checkbox {
    min-width: 28px;
    min-height: 28px;
    /* Larger touch target */
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.checkbox.checked {
    background: var(--accent-color);
}

.checkbox i {
    font-size: 16px;
    color: var(--bg-color);
}

.btn-icon {
    padding: 12px;
    /* Large touch zone */
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    min-height: auto;
}

.btn-icon:hover,
.btn-icon:active {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: flex-end;
    /* Bottom sheet logic on mobile */
    z-index: 1000;
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.modal {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 0;
    /* Bottom aligned on small screens */
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Auth View */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem 1.5rem;
}

/* Responsive Tweaks */
@media (min-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    header .header-top {
        width: auto;
    }

    header .header-controls {
        width: auto;
        padding-bottom: 0;
    }

    .modal-overlay {
        align-items: center;
        /* Center on desktop */
    }

    .modal {
        margin-bottom: auto;
        animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Lucide icon scaling */
.lucide {
    width: 24px;
    height: 24px;
}