/* Stile generale moderno - Material Design */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Colori principali */
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --primary-light: #eaefff;
    --primary-dark: #2a3f9d;
    --primary-rgb: 67, 97, 238;
    
    /* Colori secondari */
    --secondary-color: #4f5d75;
    --secondary-hover: #424e63;
    --secondary-light: #f0f2f5;
    
    /* Colori di stato */
    --success-color: #06d6a0;
    --success-hover: #05b085;
    --success-light: #e6f7ef;
    --success-rgb: 6, 214, 160;
    --warning-color: #ffd166;
    --warning-hover: #e6bc5c;
    --warning-light: #fff8e6;
    --danger-color: #ef476f;
    --danger-hover: #d63e63;
    --danger-light: #fce8ec;
    --info-color: #4cc9f0;
    --info-hover: #3ab7dc;
    --info-light: #e6f3f8;
    
    /* Colori di testo e sfondo */
    --dark-text: #2b2d42;
    --medium-text: #4f5d75;
    --light-text: #8d99ae;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --background-color: #f0f5ff;
    
    /* Ombre */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    
    /* Transizioni */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Bordi */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 50%;
    
    /* Spaziatura */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
}

/* Reset e base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--background-color);
    padding: var(--spacing-md);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

/* Logo e intestazione app */
.app-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    animation: fadeIn 0.8s ease-out;
}

.app-header h1 {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: var(--spacing-sm);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.app-logo {
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-sm);
    filter: drop-shadow(0 6px 12px rgba(67, 97, 238, 0.2));
    transition: var(--transition-bounce);
}

.app-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

/* Responsive per dispositivi mobili */
@media (max-width: 768px) {
    .app-logo {
        width: 70px;
        height: 70px;
    }
    
    .app-header h1 {
        font-size: 2.2rem;
    }
    
    .container {
        padding: var(--spacing-lg);
    }
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color) !important;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xl);
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-md);
}

h4 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
}

/* Titoli con decorazione */
.section-title {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    margin: var(--spacing-sm) auto 0;
    border-radius: 3px;
}

/* Sistema unificato di pulsanti - Material Design */
.action-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-md);
}

.action-buttons .main-buttons {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
}

/* Fix per rimuovere i trattini sotto le icone */
i, i.fas, i.far, i.fab, .fas, .far, .fab {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Base comune per tutti i pulsanti - Material Design */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
    line-height: 1.4;
    z-index: 1;
}

/* Effetto hover comune - Elevazione Material Design */
.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* Effetto active comune - Feedback tattile */
.btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Effetto ripple - Material Design */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
    z-index: -1;
}

.btn:active::after {
    animation: ripple 0.6s ease-out;
    opacity: 0;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(30, 30);
        opacity: 0;
    }
}

/* Classe per bottoni con icona + testo */
.btn-icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-icon-text i {
    font-size: 1.1em;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-icon-text:hover i {
    transform: scale(1.2);
}

/* Classe per bottoni con sola icona - Floating Action Button style */
.btn-icon-only {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-icon-only i {
    font-size: 1.4rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-icon-only:hover i {
    transform: rotate(5deg) scale(1.15);
}

.btn-icon-only:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.12);
}

/* Variante piccola per bottoni con icona + testo */
.btn-icon-text.btn-small {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.btn-icon-text.btn-small i {
    font-size: 1em;
}

/* Variante piccola per bottoni con sola icona */
.btn-icon-only.btn-small {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-icon-only.btn-small i {
    font-size: 1rem;
}

/* Variante extra-piccola per bottoni con sola icona (per azioni prodotto) */
.btn-icon-only.btn-xs {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-icon-only.btn-xs i {
    font-size: 0.9rem;
}

/* Varianti di colore */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--dark-text);
}

.btn-warning:hover {
    background-color: var(--warning-hover);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background-color: var(--success-hover);
}

.btn-info {
    background-color: var(--info-color);
    color: var(--white);
}

.btn-info:hover {
    background-color: var(--info-hover);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #e0e0e0;
    color: var(--secondary-color);
}

.btn-outline:hover {
    background-color: var(--secondary-light);
    border-color: #d0d0d0;
}

/* Compatibilità con classi esistenti */
.btn-small {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* Pulsanti nelle azioni prodotto */
.azioni-prodotto .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: var(--radius-full);
}

.azioni-prodotto .btn i {
    margin-right: 0;
}

/* Compatibilità con classi esistenti */
.btn-secondary.btn-small {
    color: var(--white);
}

/* Card Layout - Material Design */
.card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    margin-bottom: var(--spacing-md);
    position: relative;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12), 0 10px 10px rgba(0, 0, 0, 0.08);
}

.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.card:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.card-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background-color: var(--light-bg);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.card-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: rgba(0, 0, 0, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Liste moderne - Material Design Card Grid */
.liste-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.lista-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.lista-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12), 0 10px 10px rgba(0, 0, 0, 0.08);
}

.lista-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.lista-card:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.lista-link {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: var(--spacing-lg);
    flex-grow: 1;
    transition: background-color 0.3s ease;
}

.lista-link:hover {
    background-color: rgba(67, 97, 238, 0.03);
}

.lista-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.lista-titolo {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-text);
    margin: 0 0 var(--spacing-xs) 0;
    line-height: 1.3;
    position: relative;
    padding-bottom: var(--spacing-xs);
}

.lista-titolo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.lista-sottotitolo {
    font-size: 0.9rem;
    color: var(--light-text);
    margin: 0;
    font-style: italic;
    line-height: 1.4;
}

.lista-stats {
    display: flex;
    align-items: center;
    margin-top: var(--spacing-sm);
    background-color: var(--primary-light);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.lista-count {
    font-size: 0.9rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 500;
}

.lista-count i {
    font-size: 1.1em;
}

.lista-actions {
    display: flex;
    justify-content: flex-end;
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

.lista-card:hover .lista-actions {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Prodotti moderni - Material Design Cards */
.prodotti {
    margin-top: var(--spacing-xl);
}

.prodotti-container {
    list-style: none;
    padding: 0;
    margin: 0;
}

.prodotto {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background-color: var(--white);
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border-left: 4px solid transparent;
    position: relative;
}

.prodotto-contenuto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.prodotto:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px) scale(1.01);
}

.prodotto.acquistato {
    background-color: var(--success-light);
    border-left: 4px solid var(--success-color);
}

.prodotto.acquistato .nome-prodotto {
    text-decoration: line-through;
    color: var(--light-text);
}

.prodotto.acquistato::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 24px 24px 0;
    border-color: transparent var(--success-color) transparent transparent;
}

.prodotto.non-disponibile {
    background-color: var(--warning-light);
    border-left: 4px solid var(--warning-color);
}

.prodotto.non-disponibile::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 24px 24px 0;
    border-color: transparent var(--warning-color) transparent transparent;
}

.prodotto-info {
    flex: 1;
    overflow: hidden;
    padding-right: var(--spacing-md);
    max-width: 75%;
    position: relative;
}

.prodotto-testo {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nome-prodotto {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--dark-text);
    margin: 0;
    padding: 0;
    line-height: 1.3;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.prodotto:hover .nome-prodotto {
    color: var(--primary-color);
}

.quantita-prodotto {
    font-size: 0.9rem;
    color: var(--light-text);
    font-style: italic;
    margin: var(--spacing-xs) 0 0 0;
    padding: 0;
    line-height: 1.2;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.prodotto:hover .quantita-prodotto {
    opacity: 0.9;
}

.azioni-prodotto {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

/* Form moderno - Material Design */
.form-container {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.form-container:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.form-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.form-container:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.aggiungi-prodotto {
    margin: var(--spacing-lg) 0 var(--spacing-xl) 0;
    background-color: var(--white);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.aggiungi-prodotto:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.06);
}

.aggiungi-prodotto form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
    width: 100%;
    align-items: center;
}

.form-group {
    margin-bottom: var(--spacing-md);
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--dark-text);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: 'Poppins', sans-serif;
    background-color: var(--white);
    color: var(--dark-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.form-control:hover {
    border-color: #c0c0c0;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.form-text {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--light-text);
}

.aggiungi-prodotto input {
    padding: var(--spacing-md);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
    background-color: var(--white);
    color: var(--dark-text);
}

input[name="nome_prodotto"] {
    flex: 2;
}

.quantita-input {
    flex: 1;
    min-width: 100px;
}

.aggiungi-prodotto input::placeholder {
    color: var(--light-text);
    opacity: 0.7;
}

.aggiungi-prodotto input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
    background-color: var(--primary-light);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

/* Select moderno */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234f5d75' 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 var(--spacing-md) center;
    background-size: 16px;
    padding-right: var(--spacing-xl);
}

@media (max-width: 600px) {
    .form-row {
        display: flex;
        flex-direction: row;
        width: 100%;
        gap: var(--spacing-sm);
    }
    
    input[name="nome_prodotto"] {
        flex: none;
        width: 70%;
        box-sizing: border-box;
    }
    
    .quantita-input {
        flex: none;
        width: 30%;
        box-sizing: border-box;
    }
}

/* Messaggi moderni */
.empty-message {
    text-align: center;
    color: var(--light-text);
    margin: var(--spacing-xl) 0;
    font-style: italic;
    font-size: 1.1rem;
    padding: var(--spacing-lg);
    background-color: var(--light-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.alert {
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.alert:before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1.2rem;
}

.alert-success {
    background-color: var(--success-light);
    color: #0c6b58;
    border-left: 4px solid var(--success-color);
}

.alert-success:before {
    content: "\f058"; /* check-circle */
    color: var(--success-color);
}

.alert-info {
    background-color: var(--info-light);
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

.alert-info:before {
    content: "\f05a"; /* info-circle */
    color: var(--info-color);
}

.alert-warning {
    background-color: var(--warning-light);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-warning:before {
    content: "\f071"; /* exclamation-triangle */
    color: var(--warning-color);
}

.alert-danger {
    background-color: var(--danger-light);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-danger:before {
    content: "\f06a"; /* exclamation-circle */
    color: var(--danger-color);
}

/* Tabs e navigazione */
.tabs-container {
    margin-bottom: var(--spacing-xl);
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--light-bg);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.tabs-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tab-item {
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    font-weight: 500;
    color: var(--light-text);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-item:hover {
    color: var(--primary-color);
}

.tab-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.badge-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.badge-success {
    background-color: var(--success-color);
    color: var(--white);
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--dark-text);
}

.badge-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.badge-info {
    background-color: var(--info-color);
    color: var(--white);
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.pulse {
    animation: pulse 0.3s ease-in-out;
}

.container {
    animation: fadeIn 0.5s ease-out;
}

.prodotto {
    animation: slideInRight 0.3s ease-out;
}

.btn-success:active {
    animation: pulse 0.3s ease-in-out;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--light-bg);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--light-bg) 25%, #f0f0f0 50%, var(--light-bg) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: var(--radius-sm);
}

/* Responsive migliorato */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 25px 20px;
        border-radius: var(--radius-sm);
    }
    
    h1 {
        font-size: 1.5rem;
        color: var(--primary-color) !important;
        margin-bottom: 25px;
    }
    
    .btn {
        border-radius: var(--radius-sm);
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
        background-color: var(--background-color);
    }
    
    .container {
        padding: 20px 16px;
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-sm);
    }
    
    /* Fix per la visualizzazione della tipologia nel modal ricette */
    #ricettaTipologia {
        display: block !important;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 25px;
    }
    
    .action-buttons .btn {
        width: 100%;
        text-align: center;
        padding: 14px;
        justify-content: center;
        border-radius: var(--radius-sm);
    }
    
    .aggiungi-prodotto {
        margin: 20px 0 25px 0;
    }
    
    .aggiungi-prodotto form {
        flex-direction: column;
    }
    
    .aggiungi-prodotto .btn {
        padding: 12px;
    }
    
    /* Mantieni il layout orizzontale per i prodotti anche su mobile */
    .prodotto {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: var(--radius-sm);
    }
    
    .prodotto-contenuto {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .prodotto-info {
        flex: 1;
        padding-right: 10px;
        max-width: 70%;
    }
    
    .azioni-prodotto {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px;
        align-items: center;
        min-width: 80px;
        justify-content: flex-end;
    }
    
    .nome-prodotto {
        font-size: 0.95rem;
    }
    
    .liste-container li {
        margin-bottom: 12px;
        padding: 14px;
        border-radius: var(--radius-sm);
    }
}