/* Base Styles */
body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #e9ebee;
    color: #333;
    line-height: 1.6;
}
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 10px;
}
h1 {
    text-align: center;
    color: #444;
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* Form Styles */
.add-form {
    margin-bottom: 20px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.add-form input[type="text"],
.add-form input[type="number"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}
.add-form .form-ean {
    width: 100%;
    box-sizing: border-box;
}

/* Volet Styles */
.volet {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.volet.open {
    max-height: 200px;
}
.volet .volet-content-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.volet input[type="number"],
.volet textarea {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
}
.volet input[type="number"] {
    width: 80px;
}

/* Bottom Controls Row */
.bottom-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.bottom-controls-row button {
    flex-shrink: 0;
}

/* Button Styles */
.btn-green {
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-green:hover {
    background-color: #218838;
}
.scan-button {
    padding: 8px 12px;
    display: flex;
    align-items: center;
}
.scan-button img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}
.toggle-volet-button {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}
.toggle-volet-button img {
    width: 24px;
    height: 24px;
}

/* List Styles */
ul {
    list-style-type: none;
    padding: 0;
}
li {
    display: flex;
    align-items: flex-start;
    background: #fff;
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
    flex-wrap: wrap;
}
li:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
li.item-checked {
    display: none;
}
li > .item-checkbox {
    order: 1;
    margin-right: 15px;
    flex-shrink: 0;
}
li > .item-name-display {
    order: 2;
    flex-grow: 1;
    font-weight: bold;
    margin-right: 15px;
    flex-basis: 100%;
    margin-bottom: 5px;
}
@media (max-width: 600px) {
    li > .quantity-controls {
        order: 3;
        display: flex;
        align-items: center;
        margin-right: 15px;
        flex-shrink: 0;
        flex-basis: auto;
    }
    li > .item-ean-display {
        order: 4;
        font-size: 0.8em;
        color: #666;
        margin-right: 15px;
        flex-shrink: 0;
        flex-basis: auto;
    }
    li > .item-actions-container {
        order: 5;
        display: flex;
        align-items: center;
        margin-left: auto;
        gap: 10px;
        flex-shrink: 0;
        flex-basis: auto;
    }
    li .quantity-controls,
    li .item-ean-display,
    li .item-actions-container {
        display: flex;
        align-items: center;
    }
    li .quantity-controls {
        flex-grow: 0;
        margin-right: 10px;
    }
    li .item-ean-display {
        flex-grow: 1;
        text-align: center;
        margin: 0 10px;
    }
    li .item-actions-container {
        flex-grow: 0;
        margin-left: auto;
    }
}
@media (min-width: 601px) {
    li {
        flex-wrap: nowrap;
        align-items: center;
    }
    li > .item-name-display {
        flex-basis: auto;
        margin-bottom: 0;
        flex-grow: 1;
    }
    li > .item-ean-display {
        order: 3;
        flex-grow: 0;
        width: auto;
        margin-right: 15px;
        text-align: left;
    }
    li > .quantity-controls {
        order: 4;
        margin-right: 15px;
        flex-shrink: 0;
    }
    li > .item-actions-container {
        order: 5;
        margin-left: auto;
        gap: 10px;
        flex-shrink: 0;
    }
}
li > .comment-input-container {
    order: 6;
    flex-basis: 100%;
    margin-top: 10px;
    display: none;
}
.quantity-controls button {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}
.quantity-controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}
.quantity-controls button:hover:not(:disabled) {
    background-color: #0056b3;
}
.quantity-controls span {
    margin: 0 8px;
    font-size: 1.1em;
    min-width: 20px;
    text-align: center;
}

/* Responsive Styles */
@media (max-width: 600px) {
    .volet .volet-content-inner {
        flex-direction: column;
    }
    .volet .volet-content-inner > div {
        width: 100%;
    }
    .volet input[type="number"] {
        width: 80px;
    }
}
@media (min-width: 601px) {
    .volet .volet-content-inner {
        flex-direction: row;
        align-items: center;
    }
    .volet .volet-content-inner > div {
        flex-grow: 1;
    }
    .volet input[type="number"] {
        width: 80px;
        flex-shrink: 0;
        margin-right: 10px;
    }
    .volet textarea {
        flex-grow: 1;
        min-height: 40px;
    }
}
.chrono-link-placeholder {
    display: inline-block;
    height: 24px;
    width: 24px;
    line-height: 24px;
    text-align: center;
    background-color: transparent;
    vertical-align: middle;
}
.chrono-link-placeholder img {
    height: 24px;
    width: auto;
    vertical-align: middle;
}
.toggle-comment-button {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    vertical-align: middle;
}
.toggle-comment-button img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* Message Styles */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    display: none;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    display: none;
}
.add-unknown-button {
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.add-unknown-button:hover {
    background-color: #218838;
}

.add-unknown-button img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}
