* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2196f3;
    --primary-dark: #1976d2;
    --primary-light: #bbdefb;
    --accent-color: #ff4081;
    --text-primary: rgba(0, 0, 0, 0.87);
    --text-secondary: rgba(0, 0, 0, 0.54);
    --background: #f5f5f5;
    --surface: #ffffff;
    --error: #f44336;
    --spacing-unit: 16px;
    --border-radius: 8px;
    --touch-target-size: 48px;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    background-color: var(--background);
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-unit);
}

nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--surface);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px var(--spacing-unit);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: var(--touch-target-size);
    padding: 8px 16px;
    border-radius: var(--border-radius);
}

.nav-item:hover {
    background-color: rgba(0,0,0,0.04);
}

.nav-item .material-icons {
    margin-bottom: 0;
    font-size: 24px;
}

.nav-item.active .material-icons {
    color: var(--primary-color);
}

.nav-item span:not(.material-icons) {
    font-size: 14px;
    color: var(--text-secondary);
}

.page {
    display: none;
    background-color: var(--surface);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page.active {
    display: block;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-dark);
}

input {
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.suggestion-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-light);
    padding: 8px 16px;
    border-radius: 20px;
    margin: 5px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    text-transform: uppercase;
}

.suggestion-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.delete-item {
    margin-left: 8px;
    color: var(--error);
    cursor: pointer;
}

/* Modifier l'icône de quantité */
.material-icons.quantity {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0 4px;
    vertical-align: middle;
}

ul {
    list-style: none;
}

li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.predefined-items {
    margin-top: 20px;
}

.predefined-items h3 {
    margin-bottom: 10px;
    color: #666;
}

.category-group {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.category-group h4 {
    color: #2196f3;
    margin-bottom: 8px;
}

#add-predefined-item-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#add-item-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group {
    position: relative;
    flex: 1;
}

#item-name {
    width: 100%;
    text-transform: uppercase;
}

datalist {
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.fa-cubes {
    color: #666;
    margin: 0 5px;
    font-size: 0.9em;
}

/* Ajouter le style pour le bouton icône */
.icon-button {
    min-width: var(--touch-target-size);
    min-height: var(--touch-target-size);
    width: var(--touch-target-size);
    height: var(--touch-target-size);
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-button .material-icons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ajouter le style pour le select */
select {
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 70px;
}

select:focus {
    border-color: var(--primary-color);
    outline: none;
}

select:hover {
    border-color: rgba(0,0,0,0.24);
}

/* Ajouter ces styles pour les textes en majuscules */
li span {
    text-transform: uppercase;
}

/* Pour les suggestions dans le datalist */
datalist option {
    text-transform: uppercase;
}

#predefined-item-name {
    text-transform: uppercase;
}

/* Ajouter ces styles pour la liste déroulante des favoris */
.select-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    background-color: white;
    padding: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#predefined-items-select {
    width: 100%;
    min-height: 200px;
    background-color: white;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    margin-bottom: 16px;
}

#predefined-items-select option {
    padding: 12px;
    text-transform: uppercase;
    background-color: white;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

#predefined-items-select option:hover,
#predefined-items-select option:focus {
    background-color: var(--primary-light);
}

/* Ajuster la hauteur en fonction du nombre d'éléments */
#predefined-items-select[size="1"] { height: 48px; }
#predefined-items-select[size="2"] { height: 96px; }
#predefined-items-select[size="3"] { height: 144px; }
#predefined-items-select[size="4"] { height: 192px; }
#predefined-items-select[size="5"] { height: 240px; }
#predefined-items-select[size="6"] { height: 288px; }
#predefined-items-select[size="7"] { height: 336px; }
#predefined-items-select[size="8"] { height: 384px; }
#predefined-items-select[size="9"] { height: 432px; }
#predefined-items-select[size="10"] { height: 480px; }

.delete-button {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    background-color: var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
}

.delete-button .material-icons {
    font-size: 20px;
}

/* Ajustement pour différentes tailles d'écran */
@media screen and (max-width: 480px) {
    #predefined-items-select {
        max-height: calc(100vh - 200px);
    }
    
    #predefined-items-select option {
        height: 40px;
        padding: 8px;
        color: var(--text-primary);
    }
}

@media screen and (min-width: 768px) {
    .select-container {
        flex-direction: row;
        align-items: flex-start;
    }

    #predefined-items-select {
        flex: 1;
    }

    .delete-button {
        width: auto;
        margin: 0;
    }
}

/* Modifier les styles des listes déroulantes */
.input-group select {
    width: 100%;
    min-width: 200px;
}

select {
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
    text-transform: uppercase;
}

select:focus {
    border-color: var(--primary-color);
    outline: none;
}

select:hover {
    border-color: rgba(0,0,0,0.24);
}

/* Style pour l'option placeholder */
select option[disabled] {
    color: var(--text-secondary);
}

/* Ajuster la largeur du select de quantité */
#item-quantity {
    min-width: 70px;
    width: auto;
}

/* Formulaires et inputs optimisés pour le tactile */
form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.input-group {
    width: 100%;
}

select, input, button {
    min-height: var(--touch-target-size);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Ajuster les listes déroulantes pour le tactile */
select {
    width: 100%;
    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='black'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--spacing-unit) center;
    background-size: 24px;
    padding-right: 40px;
}

/* Optimiser les boutons pour le tactile */
.icon-button {
    min-width: var(--touch-target-size);
    min-height: var(--touch-target-size);
    width: var(--touch-target-size);
    height: var(--touch-target-size);
}

/* Liste des articles */
#shopping-list li, #shopping-list-checkout li {
    padding: var(--spacing-unit);
    margin-bottom: 8px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Media queries pour différentes tailles d'écran */
@media screen and (min-width: 768px) {
    /* Version desktop */
    nav {
        position: relative;
        bottom: auto;
        margin-bottom: var(--spacing-unit);
    }

    main {
        margin-bottom: 0;
    }

    form {
        flex-direction: row;
        align-items: center;
    }

    .input-group {
        flex: 1;
    }

    select {
        width: auto;
    }
}

/* Ajustements pour les très petits écrans */
@media screen and (max-width: 360px) {
    :root {
        --spacing-unit: 12px;
    }

    .nav-item .material-icons {
        font-size: 20px;
    }

    .nav-item span:not(.material-icons) {
        font-size: 12px;
    }
}

/* Désactiver les effets de hover sur les appareils tactiles */
@media (hover: none) {
    .nav-item:hover,
    button:hover,
    select:hover {
        background-color: initial;
    }
}

/* Optimisations pour iOS */
@supports (-webkit-touch-callout: none) {
    select, input, button {
        font-size: 16px; /* Évite le zoom automatique sur iOS */
    }
}

/* Ajuster l'espacement pour le contenu principal */
main {
    margin-bottom: calc(var(--touch-target-size) + 16px);
}

/* Media queries pour les petits écrans */
@media screen and (max-width: 360px) {
    .nav-item {
        padding: 8px;
        gap: 4px;
    }

    .nav-item .material-icons {
        font-size: 20px;
    }

    .nav-item span:not(.material-icons) {
        font-size: 12px;
    }
}

/* Ajouter les styles pour l'en-tête */
.app-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-icon {
    font-size: 36px;
    color: var(--primary-color);
}

.app-header h1 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

/* Ajuster pour les petits écrans */
@media screen and (max-width: 480px) {
    .app-header {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }

    .app-header h1 {
        font-size: 20px;
    }

    .header-icon {
        font-size: 32px;
    }
}

/* Styles pour les éléments de la liste */
.shopping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-unit);
    margin-bottom: 8px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.shopping-item:hover {
    transform: translateX(4px);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.quantity-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: var(--primary-light);
    border-radius: 16px;
    color: var(--primary-dark);
}

.quantity-badge .material-icons {
    font-size: 16px;
}

.quantity-number {
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.edit-button, .check-button {
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.edit-button {
    background-color: #fff3e0; /* Orange très clair */
    color: #ff9800; /* Orange Material Design (même que le "Ama") */
}

.edit-button:hover {
    background-color: #ff9800; /* Orange Material Design */
    color: white;
}

.check-button {
    min-width: var(--touch-target-size);
    min-height: var(--touch-target-size);
    width: var(--touch-target-size);
    height: var(--touch-target-size);
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #4caf50;
    color: white;
}

.check-button:hover {
    background-color: #388e3c;
}

.check-button .material-icons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ajustements pour les petits écrans */
@media screen and (max-width: 480px) {
    .shopping-item {
        padding: 12px;
    }

    .item-name {
        font-size: 14px;
    }

    .quantity-badge {
        padding: 2px 6px;
    }
}

/* Style pour le logo */
.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: auto;
    justify-content: center;
}

.logo-icons {
    position: relative;
    width: 70px;
    height: 48px;
    display: flex;
    align-items: center;
}

.running-icon {
    position: absolute;
    left: 0;
    font-size: 44px;
    color: #ff9800;
    transform: translateY(-2px);
}

.cart-icon {
    position: absolute;
    left: 24px;
    font-size: 44px;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -1px;
    line-height: 1;
}

.logo-text-ama {
    color: #ff9800; /* Orange Material Design */
}

/* Ajustement pour mobile */
@media screen and (max-width: 480px) {
    .logo-container {
        gap: 6px;
    }

    .logo-icons {
        width: 60px;
        height: 40px;
    }

    .logo-text {
        font-size: 28px;
    }
    
    .running-icon,
    .cart-icon {
        font-size: 36px;
    }
    
    .cart-icon {
        left: 20px;
    }
} 

.connection-status {
    position: static;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    margin-left: auto;
    transform: translateY(2px);
}

.connection-status.online {
    background-color: #4caf50;
    color: white;
}

.connection-status.offline {
    background-color: #f44336;
    color: white;
} 

/* Ajuster pour mobile */
@media screen and (max-width: 480px) {
    .connection-status {
        font-size: 10px;
        padding: 3px 6px;
    }
} 

/* Ajuster le conteneur du logo et du texte */
.logo-text-container {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    flex: 0 1 auto;
}

/* Ajuster l'indicateur de connexion */
.connection-status {
    position: static;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    margin-left: auto;
    transform: translateY(2px);
} 

/* Style pour le titre de la page */
.page h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 500;
}

/* Ajustement pour mobile */
@media screen and (max-width: 480px) {
    .page h2 {
        font-size: 20px;
    }
} 

/* Ajouter ces styles pour la liste des favoris */
.items-list {
    list-style: none;
    padding: 0;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions .icon-button {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.item-actions .icon-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.item-actions .delete-button {
    background-color: #ffebee;
    color: var(--error);
}

.item-actions .delete-button:hover {
    background-color: var(--error);
    color: white;
}

/* Supprimer les styles de l'ancien select qui ne sont plus nécessaires */
.select-container,
#predefined-items-select {
    display: none;
} 

/* Modifier les styles du bouton de partage */
.share-button {
    margin-top: 0;
    background-color: #4caf50; /* Vert Material Design */
    color: white;
}

.share-button:hover {
    background-color: #388e3c; /* Vert foncé Material Design */
}

@media screen and (max-width: 480px) {
    .share-button {
        margin: 20px auto;
    }
} 

/* Ajouter les styles pour l'en-tête de page */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    margin-bottom: 0; /* Supprimer la marge du titre car elle est gérée par page-header */
}

.share-button {
    margin-top: 0; /* Supprimer la marge du bouton */
}

/* Ajustement pour mobile */
@media screen and (max-width: 480px) {
    .page-header {
        gap: 12px;
    }
} 

/* Ajouter les styles pour les boutons d'action */
.action-buttons {
    display: flex;
    gap: 8px;
}

.print-button {
    background-color: #9c27b0; /* Violet Material Design */
    color: white;
}

.print-button:hover {
    background-color: #7b1fa2; /* Violet foncé Material Design */
}

@media print {
    /* Cacher les éléments non nécessaires à l'impression */
    nav, 
    .app-header,
    #add-item-form,
    .action-buttons,
    #shop-page,
    #manage-page {
        display: none !important;
    }

    /* Styles pour l'impression */
    .page {
        display: block !important;
        box-shadow: none;
        padding: 0;
    }

    .shopping-item {
        break-inside: avoid;
        border: none;
        box-shadow: none;
    }

    /* Ajuster les marges pour l'impression */
    @page {
        margin: 1cm;
    }
} 