:root {
    --primary-blue: #1E293B; /* Slate 800 */
    --highlight-teal: #00D2B5; /* Minty/Carbetic accent */
    --bg-gradient: linear-gradient(135deg, #F0F4F8 0%, #E2E8F0 100%);
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-border: 1px solid rgba(255, 255, 255, 0.6);
    --text-dark: #334155; /* Slate 700 */
    --text-muted: #64748B; /* Slate 500 */
    --border-radius: 28px;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    width: 180px;
    animation: pulse 2.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.app-header {
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    width: 100%;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 75px; /* Significantly increased height for the SVG */
    max-width: 60vw; /* Prevent it from overlapping buttons on tiny screens */
    width: auto;
    display: block;
}

.logo .highlight {
    color: var(--highlight-teal);
}

.scan-counter {
    background: linear-gradient(135deg, #00D2B5, #00A68F);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 800;
    color: white;
    box-shadow: 0 6px 16px rgba(0, 210, 181, 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-menu {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-menu:active {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Fullscreen Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: flex-end;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    background: var(--card-bg);
    width: 280px;
    height: 100%;
    padding: 24px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.menu-overlay.active .menu-content {
    transform: translateX(0);
}

.btn-close-menu {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 32px;
    padding: 8px;
    border-radius: 50%;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: var(--card-border);
    border-radius: 16px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
    text-align: left;
}

.menu-item:active {
    transform: scale(0.96);
}

.menu-icon {
    font-size: 24px;
}

.app-content {
    flex: 1;
    padding: 90px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.view {
    display: none;
    width: 100%;
    max-width: 500px;
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.view.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--card-bg);
    border: var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card h2 {
    color: var(--primary-blue);
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.card p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Opener Specific */
.tutorial-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.tutorial-step {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tutorial-step span {
    font-weight: 800;
    color: var(--highlight-teal);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-step p {
    font-size: 14px !important;
    margin-bottom: 0 !important;
    color: var(--primary-blue) !important;
    font-weight: 600;
}

.opener-hero {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    object-fit: cover;
    height: 200px;
}

.jar-container {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.jar-container img.bg-jar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jar-container img.overlay-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px; /* Größe des Logos auf dem Glas */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 18px;
    border-radius: 100px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background-color: var(--highlight-teal);
    color: white;
    box-shadow: 0 8px 20px rgba(0, 210, 181, 0.25);
}

.btn-primary:hover {
    background-color: #00E6C7;
    box-shadow: 0 10px 24px rgba(0, 210, 181, 0.35);
}

.btn-large {
    font-size: 18px;
    padding: 20px;
}

.btn-secondary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-text {
    background: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px;
}

.icon {
    font-size: 22px;
    margin-right: 12px;
}

/* Inputs & Forms */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-blue);
}

.input-group input[type="number"] {
    width: 100%;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-blue);
    outline: none;
    transition: all 0.2s;
}

.input-group input[type="number"]:focus {
    border-color: var(--highlight-teal);
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 210, 181, 0.1);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 100px;
    overflow: hidden;
    padding: 4px;
}

.toggle-switch input {
    display: none;
}

.toggle-switch label {
    flex: 1;
    text-align: center;
    padding: 14px;
    margin: 0;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s;
    border-radius: 100px;
}

.toggle-switch input:checked + label {
    background-color: white;
    color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Loader */
.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 4px solid rgba(0, 210, 181, 0.1);
    border-top-color: var(--highlight-teal);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result View */
.success-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-15px);}
    60% {transform: translateY(-7px);}
}

.result-box {
    background: linear-gradient(135deg, var(--highlight-teal), #00A68F);
    color: white;
    padding: 36px 20px;
    border-radius: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 24px rgba(0, 210, 181, 0.2);
}

.result-grams {
    font-size: 56px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.result-label {
    font-size: 18px;
    font-weight: 600;
    opacity: 0.9;
}

.info-box {
    background-color: var(--bg-light);
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-blue);
}

/* Paywall */
.price-tag {
    font-size: 36px;
    font-weight: 900;
    color: var(--primary-blue);
    margin: 24px 0;
    letter-spacing: -1px;
}

.small-text {
    font-size: 14px !important;
    margin-top: 16px;
}

/* Account Tiers */
.tiers-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.tier-card {
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.tier-card.active-tier {
    border-color: var(--highlight-teal);
    background-color: rgba(0, 210, 181, 0.05);
}

.tier-card.premium-tier {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    border-color: #0d9488;
}

.tier-badge {
    position: absolute;
    top: -12px;
    right: 16px;
    background: var(--highlight-teal);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0,210,181,0.3);
}

.tier-badge.premium {
    background: #0d9488;
    box-shadow: 0 4px 8px rgba(13,148,136,0.3);
}

.tier-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--highlight-teal);
    margin-bottom: 16px;
}

.premium-tier .tier-price {
    color: #0d9488;
}

.tier-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
}

.tier-features li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toast Notification for Back Button Exit */
#exitToast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(30, 41, 59, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#exitToast.show {
    opacity: 1;
}
