/* Pantry-Themed Styles */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

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

:root {
    --pantry-cream: #FFF8E7;
    --pantry-wood: #8B7355;
    --pantry-dark-wood: #5D4E37;
    --pantry-green: #7CA982;
    --pantry-light-green: #A8D5BA;
    --pantry-orange: #E8925C;
    --pantry-red: #D76A6A;
    --pantry-white: #FFFFFF;
    --pantry-shadow: rgba(93, 78, 55, 0.15);
    --pantry-shadow-hover: rgba(93, 78, 55, 0.25);
}

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--pantry-cream) 0%, #FFE4B5 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 0;
}

/* Decorative background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(139, 115, 85, 0.03) 50px, rgba(139, 115, 85, 0.03) 51px);
    pointer-events: none;
    z-index: 0;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--pantry-wood) 0%, var(--pantry-dark-wood) 100%);
    padding: 30px 40px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px var(--pantry-shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '🥫';
    position: absolute;
    left: -20px;
    top: -20px;
    font-size: 120px;
    opacity: 0.1;
    transform: rotate(-15deg);
}

header::after {
    content: '🍞';
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 100px;
    opacity: 0.1;
    transform: rotate(15deg);
}

header h1 {
    color: var(--pantry-white);
    font-size: 36px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

header h1::before {
    content: '🏺';
    font-size: 40px;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

#user-email {
    color: var(--pantry-cream);
    font-size: 15px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Buttons */
button {
    background: var(--pantry-green);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
}

#help-btn {
    background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
}

#help-btn:hover {
    background: linear-gradient(135deg, #2980B9 0%, #21618C 100%);
}

#logout-btn {
    background: var(--pantry-red);
}

#logout-btn:hover {
    background: #c85858;
}

/* Add Item Section */
.add-item-section {
    background: var(--pantry-white);
    padding: 30px 35px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px var(--pantry-shadow);
    border: 3px solid var(--pantry-light-green);
    position: relative;
    overflow: hidden;
}

.add-item-section::before {
    content: '➕';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 80px;
    opacity: 0.08;
}

.add-item-section h2 {
    color: var(--pantry-dark-wood);
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-item-section h2::before {
    content: '📝';
    font-size: 28px;
}

#add-item-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr auto;
    gap: 15px;
    align-items: center;
}

#add-item-form input {
    padding: 14px 18px;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    background: #FAFAFA;
    transition: all 0.3s ease;
}

#add-item-form input:focus {
    outline: none;
    border-color: var(--pantry-green);
    background: white;
    box-shadow: 0 0 0 3px rgba(124, 169, 130, 0.1);
}

#add-item-form input::placeholder {
    color: #999;
}

#add-item-form button {
    padding: 14px 30px;
    font-size: 16px;
    white-space: nowrap;
}

/* Search and Filter Controls */
.controls-section {
    background: var(--pantry-white);
    padding: 25px 35px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px var(--pantry-shadow);
    border: 2px solid #E8E8E8;
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    background: #FAFAFA;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--pantry-wood);
    background: white;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.filter-sort-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    color: var(--pantry-dark-wood);
    font-size: 14px;
    font-weight: 600;
}

.control-group select {
    padding: 12px 16px;
    border: 2px solid #E8E8E8;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: var(--pantry-wood);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.control-group select[multiple] {
    min-height: 46px;
}

.secondary-btn {
    background: linear-gradient(135deg, #95A5A6 0%, #7F8C8D 100%);
    padding: 12px 24px;
    white-space: nowrap;
}

.secondary-btn:hover {
    background: linear-gradient(135deg, #7F8C8D 0%, #6C7A7B 100%);
}

/* Items Sections */
.items-section {
    background: var(--pantry-white);
    padding: 30px 35px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px var(--pantry-shadow);
    border-top: 5px solid var(--pantry-green);
}

.items-section.out-of-stock {
    border-top-color: var(--pantry-red);
}

.items-section h2 {
    color: var(--pantry-dark-wood);
    margin-bottom: 25px;
    font-size: 26px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--pantry-light-green);
    display: flex;
    align-items: center;
    gap: 12px;
}

.items-section:first-of-type h2::before {
    content: '🏪';
    font-size: 30px;
}

.items-section.out-of-stock h2 {
    border-bottom-color: #FFCCCC;
}

.items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.empty-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 40px;
    font-size: 16px;
    background: #F9F9F9;
    border-radius: 15px;
    border: 2px dashed #DDD;
}

/* Item Cards - Compact Mobile-Optimized */
.item-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F8F8 100%);
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--pantry-green) 0%, var(--pantry-light-green) 100%);
}

.items-section:last-of-type .item-card::before {
    background: linear-gradient(180deg, var(--pantry-orange) 0%, #FFB88C 100%);
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px var(--pantry-shadow-hover);
    border-color: var(--pantry-green);
}

.items-section:last-of-type .item-card:hover {
    border-color: var(--pantry-orange);
}

/* Item Header */
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.item-header h3 {
    color: var(--pantry-dark-wood);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    min-width: 150px;
}

.item-header .category {
    display: inline-block;
    background: linear-gradient(135deg, var(--pantry-light-green) 0%, var(--pantry-green) 100%);
    color: white;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 15px;
    white-space: nowrap;
}

/* Quantity Control */
.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 8px;
    background: #F5F5F5;
    border-radius: 10px;
    border: 2px solid #E0E0E0;
}

.quantity-display {
    font-size: 24px;
    font-weight: 700;
    color: var(--pantry-dark-wood);
    min-width: 50px;
    text-align: center;
}

.qty-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.qty-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.qty-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.minus-btn {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
}

.minus-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #C0392B 0%, #A93226 100%);
}

.plus-btn {
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
}

.plus-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #229954 0%, #1E8449 100%);
}

/* Item Actions - Compact */
.item-actions {
    display: flex;
    gap: 8px;
    justify-content: stretch;
}

.item-actions button {
    flex: 1;
    padding: 10px;
    font-size: 20px;
    min-width: 0;
    border-radius: 10px;
}

.edit-btn {
    background: linear-gradient(135deg, #5DADE2 0%, #3498DB 100%);
}

.edit-btn:hover {
    background: linear-gradient(135deg, #4FA3D8 0%, #2980B9 100%);
}

.move-btn {
    background: linear-gradient(135deg, var(--pantry-orange) 0%, #E67E3C 100%);
}

.move-btn:hover {
    background: linear-gradient(135deg, #E67E3C 0%, #D86C2C 100%);
}

.delete-btn {
    background: linear-gradient(135deg, var(--pantry-red) 0%, #C75A5A 100%);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #C75A5A 0%, #B74A4A 100%);
}

/* Shopping List Section */
.shopping-list-section {
    background: var(--pantry-white);
    padding: 30px 35px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px var(--pantry-shadow);
    border-top: 5px solid #9B59B6;
}

.shopping-list-section h2 {
    color: var(--pantry-dark-wood);
    margin-bottom: 25px;
    font-size: 26px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 3px solid #D7BDE2;
    display: flex;
    align-items: center;
    gap: 12px;
}

.shopping-list-section h2::before {
    content: '🛒';
    font-size: 30px;
}

.add-shopping-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr auto;
    gap: 12px;
    margin-bottom: 25px;
    padding: 20px;
    background: #F9F9F9;
    border-radius: 12px;
    border: 2px dashed #DDD;
}

.add-shopping-form input {
    padding: 12px 16px;
    border: 2px solid #E8E8E8;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    background: white;
    transition: all 0.3s ease;
}

.add-shopping-form input:focus {
    outline: none;
    border-color: #9B59B6;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
}

.add-shopping-form button {
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 100%);
    padding: 12px 20px;
    white-space: nowrap;
}

.add-shopping-form button:hover {
    background: linear-gradient(135deg, #8E44AD 0%, #7D3C98 100%);
}

/* Shopping Items List */
.shopping-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shopping-item-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAF9FB 100%);
    border: 2px solid #E8E8E8;
    border-left: 4px solid #9B59B6;
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.shopping-item-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.15);
    border-left-width: 6px;
}

.shopping-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.shopping-item-info h4 {
    color: var(--pantry-dark-wood);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.shopping-quantity {
    background: #F0F0F0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.shopping-item-info .category {
    background: linear-gradient(135deg, #D7BDE2 0%, #C39BD3 100%);
    color: white;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 15px;
}

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

.complete-btn {
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.complete-btn:hover {
    background: linear-gradient(135deg, #229954 0%, #1E8449 100%);
    transform: scale(1.1);
}

.remove-btn {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: linear-gradient(135deg, #C0392B 0%, #A93226 100%);
    transform: scale(1.1);
}

.modal-item-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--pantry-dark-wood);
    margin-bottom: 15px;
    padding: 12px;
    background: #F9F9F9;
    border-radius: 10px;
    text-align: center;
}

#add-to-shopping-form label {
    display: block;
    margin-bottom: 10px;
    color: var(--pantry-dark-wood);
    font-weight: 600;
}

/* Help Modal Styling */
.help-modal-content {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    border-top: 5px solid #3498DB;
}

.help-modal-content h2 {
    color: #3498DB;
    margin-bottom: 30px;
    text-align: center;
}

.help-section {
    background: #F9F9F9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--pantry-green);
}

.help-section h3 {
    color: var(--pantry-dark-wood);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.help-section p {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 0;
}

.help-section ul,
.help-section ol {
    color: #555;
    font-size: 15px;
    line-height: 1.8;
    margin: 12px 0 0 20px;
}

.help-section li {
    margin-bottom: 8px;
}

.icon-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.icon-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 2px solid #E8E8E8;
}

.icon-demo {
    font-size: 24px;
    min-width: 40px;
    text-align: center;
}

.icon-item span:last-child {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.help-tip {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-left-color: #4CAF50;
    font-size: 15px;
}

.help-tip strong {
    color: #2E7D32;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(93, 78, 55, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--pantry-white);
    margin: 8% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
    border-top: 5px solid var(--pantry-green);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: var(--pantry-dark-wood);
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-content h2::before {
    content: '✏️';
    font-size: 30px;
}

.close,
.close-shopping,
.close-help {
    color: var(--pantry-red);
    float: right;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    margin-top: -10px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(215, 106, 106, 0.15);
    border-radius: 50%;
    border: 2px solid var(--pantry-red);
}

.close:hover,
.close-shopping:hover,
.close-help:hover {
    background: var(--pantry-red);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(215, 106, 106, 0.4);
}

#edit-item-form input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 18px;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    background: #FAFAFA;
    transition: all 0.3s ease;
}

#edit-item-form input:focus {
    outline: none;
    border-color: var(--pantry-green);
    background: white;
    box-shadow: 0 0 0 3px rgba(124, 169, 130, 0.1);
}

#edit-item-form button {
    width: 100%;
    padding: 16px;
    font-size: 17px;
}

/* Auth Page Styles */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: var(--pantry-white);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--pantry-shadow);
    width: 90%;
    max-width: 450px;
    border-top: 5px solid var(--pantry-wood);
}

.auth-container h1 {
    color: var(--pantry-dark-wood);
    text-align: center;
    margin-bottom: 35px;
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.auth-container h1::before {
    content: '🏺';
    font-size: 40px;
}

.auth-section h2 {
    color: var(--pantry-dark-wood);
    margin-bottom: 25px;
    font-size: 26px;
    font-weight: 700;
}

.auth-section form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-section input {
    padding: 14px 18px;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    background: #FAFAFA;
    transition: all 0.3s ease;
}

.auth-section input:focus {
    outline: none;
    border-color: var(--pantry-wood);
    background: white;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.auth-section button {
    padding: 16px;
    font-size: 17px;
    background: linear-gradient(135deg, var(--pantry-wood) 0%, var(--pantry-dark-wood) 100%);
}

.auth-section button:hover {
    background: linear-gradient(135deg, var(--pantry-dark-wood) 0%, #4D3E2A 100%);
}

.auth-section p {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 15px;
    font-weight: 500;
}

.auth-section a {
    color: var(--pantry-wood);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.auth-section a:hover {
    color: var(--pantry-dark-wood);
    text-decoration: underline;
}

.message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.message.success {
    background: #D4EDDA;
    color: #155724;
    border: 2px solid #C3E6CB;
}

.message.error {
    background: #F8D7DA;
    color: #721C24;
    border: 2px solid #F5C6CB;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .items-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    #app {
        padding: 15px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    header h1::before {
        font-size: 28px;
    }

    header::before,
    header::after {
        display: none;
    }

    #user-email {
        font-size: 13px;
        padding: 6px 12px;
    }

    .add-item-section,
    .items-section,
    .controls-section,
    .shopping-list-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .add-item-section h2,
    .items-section h2,
    .shopping-list-section h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .add-item-section::before {
        display: none;
    }

    #add-item-form,
    .add-shopping-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #add-item-form input,
    .add-shopping-form input {
        padding: 12px 15px;
    }

    .filter-sort-controls {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .items-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .item-card {
        padding: 12px;
    }

    .quantity-display {
        font-size: 20px;
        min-width: 40px;
    }

    .qty-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .auth-container {
        padding: 30px;
    }

    .modal-content,
    .help-modal-content {
        margin: 10% auto;
        padding: 25px;
        width: 95%;
    }

    .help-modal-content {
        max-height: 80vh;
    }

    .icon-guide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #app {
        padding: 10px;
    }

    header {
        padding: 15px;
    }

    header h1 {
        font-size: 20px;
    }

    .add-item-section,
    .items-section,
    .controls-section,
    .shopping-list-section {
        padding: 15px;
        border-radius: 15px;
    }

    .item-card,
    .shopping-item-card {
        padding: 12px;
        gap: 10px;
    }

    .shopping-item-info {
        flex-wrap: wrap;
        gap: 8px;
    }

    .item-header h3 {
        font-size: 16px;
    }

    .quantity-control {
        gap: 10px;
        padding: 6px;
    }

    .quantity-display {
        font-size: 18px;
        min-width: 35px;
    }

    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .item-actions button {
        font-size: 18px;
        padding: 8px;
    }

    button {
        padding: 10px 18px;
        font-size: 14px;
    }

    .help-modal-content {
        padding: 20px;
        max-height: 75vh;
    }

    .help-section {
        padding: 15px;
    }

    .help-section h3 {
        font-size: 18px;
    }

    .icon-item {
        padding: 8px;
    }

    .icon-demo {
        font-size: 20px;
        min-width: 35px;
    }
}
