:root {
    /* Color Palette - Vibrant Dark Mode Glassmorphism */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #6366f1;
    /* Indigo */
    --accent-hover: #818cf8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --danger-hover: #f87171;
    --item-bg: rgba(15, 23, 42, 0.4);
    --item-border: rgba(255, 255, 255, 0.05);

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);

    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    line-height: 1.5;
}

/* Hlavní kontejner aplikace */
.app-container {
    width: 100%;
    max-width: 500px;
    margin-top: 5vh;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 30px 25px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Hlavička */
header {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
}

/* Sekce přidávání položek */
.input-section form {
    display: flex;
    gap: 12px;
    position: relative;
}

#item-input {
    flex: 1;
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    color: var(--text-primary);
    font-size: 1rem;
    padding: 14px 20px;
    border-radius: var(--radius-full);
    outline: none;
    transition: all var(--transition-fast);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#item-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#item-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#add-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

#add-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

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

/* Seznam položek */
.list-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

#items-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.text-btn:hover {
    color: var(--danger-color);
}

#shopping-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 5px;
}

/* Vlastní scrollbar */
#shopping-list::-webkit-scrollbar {
    width: 6px;
}

#shopping-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

#shopping-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Položka seznamu */
.list-item {
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-normal);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

.list-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.list-item.completed {
    opacity: 0.5;
}

.list-item.completed .item-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Checkbox (Custom) */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-visual {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-fast);
}

.list-item.completed .checkbox-visual {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.checkbox-visual i {
    color: white;
    font-size: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

.list-item.completed .checkbox-visual i {
    opacity: 1;
    transform: scale(1);
}

/* Text položky */
.item-text {
    flex: 1;
    font-size: 1.05rem;
    transition: color 0.3s ease;
    word-break: break-word;
}

/* Tlačítka akcí u položky */
.item-actions {
    display: flex;
    gap: 8px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.list-item:hover .item-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-hover);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.5;
}

/* Edit State */
.edit-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
    font-size: 1.05rem;
    padding: 6px 10px;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
}

/* Responzifita pro mobily */
@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .app-container {
        margin-top: 0;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--card-border);
    }

    .item-actions {
        opacity: 1;
        /* Na mobilu vždy viditelné */
    }
}