:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --light-color: #f9f9f9;
    --dark-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --family-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--family-font);
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background-color: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-right: 15px;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.tagline {
    color: #666;
    font-style: italic;
}

.search-section {
    margin-bottom: 30px;
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

#search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#search-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: var(--shadow);
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f0f8ff;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.quantity-selector label {
    margin-right: 10px;
    font-weight: bold;
    color: var(--dark-color);
}

select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    flex-grow: 1;
    background-color: white;
}

button {
    background: linear-gradient(to right, var(--primary-color), #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
}

.lists-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.list-section {
    flex: 1;
    min-width: 300px;
    background-color: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.list-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.list-title h2 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.list-icon {
    margin-right: 10px;
    font-size: 1.5rem;
}

.counter {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.comprata .list-title h2 {
    color: var(--secondary-color);
}

.comprata .counter {
    background-color: var(--secondary-color);
}

.list-items {
    flex-grow: 1;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Stile per la scrollbar */
.list-items::-webkit-scrollbar {
    width: 8px;
}

.list-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.list-items::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    border-radius: 8px;
    margin-bottom: 8px;
}

.list-item:hover {
    background-color: #f9f9f9;
}

.item-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.item-quantity {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);
}

.comprata .item-quantity {
    background-color: var(--secondary-color);
}

.item-name {
    font-weight: 500;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background-color: transparent;
    color: var(--dark-color);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.move-btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.move-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.delete-btn {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.delete-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.comprata .move-btn {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.comprata .move-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

.empty-message {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    font-style: italic;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .lists-container {
        flex-direction: column;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .quantity-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    button {
        width: 100%;
    }
}