:root { 
    --primary: #007aff; 
    --bg: #f2f2f7; 
    --card: #ffffff; 
    --text: #1c1c1e; 
    --danger: #ff3b30;
    --success: #34c759;
    --warning: #ff9500;
    --angebot: #e83e8c; /* Die neue Angebots-Farbe (Pink) */
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background-color: var(--bg); 
    color: var(--text); 
    margin: 0; 
    padding: 0; 
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- LOGIN SCREEN STYLES --- */
#loginScreen { 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    height: 100vh; background-color: var(--bg); padding: 20px; box-sizing: border-box; 
}
.login-box { 
    background: var(--card); padding: 35px; border-radius: 25px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; 
}
.login-box h1 { margin-top: 0; font-size: 26px; color: var(--text); margin-bottom: 30px; }
.login-box input { 
    width: 100%; padding: 16px; margin-bottom: 15px; border: 1px solid #ddd; 
    border-radius: 12px; font-size: 16px; box-sizing: border-box; background: #f9f9f9;
}
.login-box button { 
    width: 100%; padding: 16px; background: var(--primary); color: white; border: none; 
    border-radius: 12px; font-size: 18px; font-weight: bold; cursor: pointer; margin-bottom: 10px;
}
.login-error { color: var(--danger); font-size: 14px; margin-bottom: 15px; display: none; font-weight: bold; }

/* Haupt-Inhalt initial verstecken */
#appContent { display: none; min-height: 100vh; }

/* --- HEADER & NAVIGATION --- */
header { 
    background: var(--card); padding: 15px 15px 5px 15px; text-align: center; 
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 1000;
}
.header-top { display: flex; justify-content: center; align-items: center; position: relative; margin-bottom: 12px; }
.header-top h1 { margin: 0; font-size: 22px; font-weight: 800; }
.icon-btn { position: absolute; right: 0; background: none; border: none; font-size: 26px; cursor: pointer; padding: 5px; }

/* REITER ZENTRIERUNG & OPTIK */
.tabs { 
    display: flex; justify-content: center; gap: 8px; overflow-x: auto; 
    scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 5px 0 10px 0;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs button { 
    border: none; background: transparent; font-size: 15px; color: #8e8e93; 
    padding: 8px 14px; cursor: pointer; white-space: nowrap; position: relative; transition: color 0.2s;
}
.tabs button.active { color: var(--primary); font-weight: bold; }
.tabs button.active::after {
    content: ""; position: absolute; bottom: 0; left: 20%; right: 20%; height: 3px; background: var(--primary); border-radius: 3px;
}

/* ZÄHLER-BADGE */
.tab-badge { 
    background-color: var(--danger); color: white; font-size: 10px; padding: 2px 6px; 
    border-radius: 10px; margin-left: 5px; vertical-align: middle; font-weight: bold; display: inline-block;
} 
.unread-pulse {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* ECHTES POP-UP */
.update-notification {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background-color: var(--danger); color: white; padding: 15px 25px;
    border-radius: 15px; z-index: 9999; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    font-size: 16px; text-align: center; cursor: pointer; width: 85%; max-width: 400px;
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.update-notification small { display: block; margin-top: 5px; opacity: 0.8; font-weight: normal; font-size: 12px;}
@keyframes slideDown { 0% { top: -50px; opacity: 0; } 100% { top: 20px; opacity: 1; } }

#statusAnzeige { font-size: 11px; color: var(--primary); font-weight: bold; margin-top: 5px; min-height: 15px; }

/* --- HAUPTBEREICH --- */
main { padding: 15px; max-width: 600px; margin: 0 auto; padding-bottom: 80px; }

.input-area { 
    background: var(--card); padding: 15px; border-radius: 18px; margin-bottom: 25px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: relative;
}
.eingabe-zeile { display: flex; gap: 10px; margin-bottom: 12px; }
.supermarkt-zeile { display: flex; gap: 10px; width: 100%; align-items: center; }

input { 
    box-sizing: border-box; width: 100%; padding: 14px; border: 1px solid #ddd; 
    border-radius: 12px; font-size: 16px; background: #fff;
}
.eingabe-zeile input { flex: 1; }

button { background: var(--primary); color: white; border: none; border-radius: 12px; padding: 12px 18px; cursor: pointer; font-weight: bold; }
.scanner-btn { background: var(--success); font-size: 20px; }

/* --- LISTE --- */
ul { list-style: none !important; padding: 0; margin: 0; }
li { 
    background: var(--card); margin-bottom: 12px; padding: 14px; border-radius: 15px; 
    display: flex; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: transform 0.1s;
}
li.erledigt { opacity: 0.5; }

.prod-text { flex: 1; cursor: pointer; line-height: 1.4; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 16px; }
li.erledigt .prod-text { text-decoration: line-through; }

.item-thumbnail { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; border: 1px solid #eee; flex-shrink: 0; cursor: pointer; }

/* Das Supermarkt Schildchen */
.supermarkt-badge { 
    display: inline-flex; align-items: center; font-size: 11px; background-color: var(--primary); 
    color: white; padding: 4px 12px; border-radius: 14px; font-weight: bold; cursor: pointer; 
}
.supermarkt-badge.empty { background-color: var(--warning); }
.supermarkt-badge img { width: 14px; height: 14px; margin-right: 6px; border-radius: 2px; background: white; object-fit: contain; }

/* NEU: Das Angebots-Schildchen! */
.angebot-badge {
    display: inline-flex; align-items: center; font-size: 11px; background-color: var(--angebot);
    color: white; padding: 4px 10px; border-radius: 14px; font-weight: bold; margin-left: 5px;
    box-shadow: 0 2px 5px rgba(232, 62, 140, 0.4);
}

.menge-control { display: flex; align-items: center; gap: 10px; margin-right: 15px; background: #f2f2f7; border-radius: 10px; padding: 5px 10px; }
.menge-btn { background: none; color: var(--primary); font-size: 22px; padding: 0 5px; border: none; cursor: pointer; font-weight: bold; }

.icon-action-btn { background: none; font-size: 18px; padding: 8px; color: #555; display:flex; align-items:center; justify-content:center; border:none; cursor:pointer; }
.loesch-btn { color: var(--danger); }

/* --- AKTIONEN FOOTER --- */
.action-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
.clear-btn { background-color: var(--warning); color: white; width: 100%; font-size: 16px; }
.delete-all-btn { background-color: var(--danger); color: white; width: 100%; font-size: 16px; }
.delete-tab-btn { background-color: #8e8e93; color: white; width: 100%; font-size: 14px; margin-top: 20px;}
.logout-btn { background-color: #333; color: white; width: 100%; margin-top: 40px; padding: 15px; border-radius: 12px; border: none; font-weight: bold; font-size: 16px;}

/* --- MODAL STYLES --- */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-content { background-color: #fff; margin: 15% auto; padding: 25px; border-radius: 25px; width: 90%; max-width: 500px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); position: relative; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 20px; }
.modal-header h2 { margin: 0; font-size: 20px; }
.close-btn { background: none; color: #ccc; font-size: 35px; font-weight: bold; border:none; cursor: pointer; padding: 0; line-height: 1; }

.menu-nav-btn { width: 100%; padding: 20px; margin-bottom: 12px; font-size: 16px; font-weight: bold; background: #f9f9f9; color: #333; border: 1px solid #e5e5ea; border-radius: 15px; text-align: left; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.back-btn { background: none; color: var(--primary); font-size: 16px; padding: 0 0 15px 0; font-weight: bold; border: none; cursor: pointer; }

.menu-add-box { display: flex; gap: 8px; margin-bottom: 20px; }
.menu-add-box input, .menu-add-box select { flex: 1; padding: 12px; border: 1px solid #ccc; border-radius: 10px; font-size: 14px;}
.menu-add-box button { background: var(--success); padding: 0 15px; border-radius: 10px; border: none; color: white; font-weight: bold; font-size: 18px;}

.settings-list { list-style: none !important; padding: 0; margin: 0; }
.settings-list li { background: #f9f9f9; border: 1px solid #eee; margin-bottom: 10px; padding: 12px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.action-group { display: flex; gap: 5px; align-items: center;}

.edit-select { width: 100%; padding: 10px; margin-top: 8px; border-radius: 8px; border: 1px solid #ddd; background: white; font-size: 14px;}
.produkt-list-item { background: #f9f9f9; border: 1px solid #eee; margin-bottom: 15px; padding: 15px; border-radius: 15px; }

/* --- VORSCHLÄGE BOX --- */
.vorschlaege-box { position: absolute; top: 100%; left: 0; width: 100%; background: white; border: 1px solid #ccc; border-radius: 12px; z-index: 2000; display: none; max-height: 250px; overflow-y: auto; margin-top: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.vorschlag-item { padding: 15px; cursor: pointer; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.vorschlag-item:hover { background: #f0f0f0; }
.badge-memory { background: #ffcc00; color: #333; font-size: 10px; padding: 3px 6px; border-radius: 5px; font-weight: bold; }
.badge-web { background: #eee; color: #666; font-size: 10px; padding: 3px 6px; border-radius: 5px; font-weight: bold; }

.upload-option-btn { width: 100%; padding: 18px; border-radius: 15px; border: none; font-size: 16px; font-weight: bold; cursor: pointer; color: white; display: flex; justify-content: center; gap: 12px; margin-bottom: 12px; }
#imageViewerModal .modal-content { background: transparent; box-shadow: none; display:flex; flex-direction:column; align-items:center; }
#imageViewerImg { max-width: 100%; max-height: 80vh; border-radius: 20px; box-shadow: 0 15px 50px rgba(0,0,0,0.6); }