:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;

    --primary-hue: 150;
    /* Green/Teal */
    --primary: hsl(var(--primary-hue), 100%, 45%);
    --primary-glow: hsl(var(--primary-hue), 100%, 45%, 0.5);

    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 4rem;
    overflow-x: hidden;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    /* Indigo accent */
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ec4899 0%, transparent 70%);
    /* Pink accent */
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* App Wrapper */
.app-wrapper {
    width: 100%;
    max-width: 480px;
    padding: 0 1rem;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
    filter: drop-shadow(0 0 12px var(--primary-glow));
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 1px;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: var(--glass-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

/* Form */
#add-item-form {
    padding: 1rem;
}

.input-group {
    display: flex;
    gap: 0.75rem;
}

input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

#item-name {
    flex: 2;
}

#item-quantity {
    width: 5rem;
    text-align: center;
}

.add-btn {
    background: var(--primary);
    border: none;
    border-radius: 0.75rem;
    width: 3.25rem;
    color: #0f172a;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--primary-glow);
}

.add-btn:active {
    transform: scale(0.95);
}

/* List */
#list-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(4px);
}

.check-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}

.list-item.done .check-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: #0f172a;
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}

.item-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.item-description:hover {
    color: var(--primary);
}

.item-description.empty {
    font-style: italic;
    opacity: 0.5;
    font-size: 0.75rem;
}

.item-name {
    font-size: 1.1rem;
    transition: opacity 0.3s;
}

.item-qty {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    color: var(--text-muted);
}

.list-item.done .item-name {
    text-decoration: line-through;
    opacity: 0.5;
    color: var(--text-muted);
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0.5rem;
}

.list-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* Empty State */
#empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.icon-box {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.hidden {
    display: none !important;
}

/* Spinner */
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.6;
    opacity: 0.6;
}

.list-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: color 0.3s;
    font-style: italic;
    opacity: 0.8;
}

.list-description:hover {
    color: var(--primary);
    opacity: 1;
}

.list-description.empty {
    opacity: 0.5;
    font-size: 0.85rem;
}

/* Notifications */
#notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: var(--primary);
}

.toast.error i {
    color: var(--danger);
}

.toast.info i {
    color: #3b82f6;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal Overlay */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#modal-overlay.active .modal {
    transform: scale(1);
}

.modal h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 1rem;
}

.modal-btn:hover {
    transform: scale(1.05);
}

.modal-btn.primary {
    background: var(--primary);
    color: #0f172a;
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.modal-btn.danger {
    background: var(--danger);
    color: white;
}

/* Pull to Refresh */
.pull-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
    opacity: 0.7;
    margin-bottom: -10px;
    /* pull content up slightly */
}

.pull-indicator.visible {
    height: 50px;
    margin-bottom: 0;
}

.pull-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

/* Search Section Headers */
.section-header {
    padding: 0.5rem 0.25rem;
    color: var(--primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-top: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
    list-style: none;
    /* since it will be an li */
}

.section-header:first-child {
    margin-top: 0;
}