/**
 * SANTA-CLOUD STYLESHEET
 * Version: 2.5.0 (Feature: Mobile Header Left-Align)
 * Base: Version 2.4.0
 */

:root { --primary: #d42426; --bg: #1e3c72; --amazon: #ff9900; --success: #28a745; --faded: #ccc; --error: #e53e3e; --share: #007bff; }

*, *::before, *::after { box-sizing: border-box; }

/* 1. Die dunkle Leinwand (Sicherheitsnetz gegen weißen Blitz) */
html {
    background-color: #000;
    height: 100%;
}

body { 
    font-family: 'Inter', sans-serif; 
    margin: 0; 
    padding: 0; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    overflow-x: hidden; 
    
    /* Sanfter Theme-Wechsel */
    transition: background 0.5s ease;
}

/* Wichtig: Transparent, damit Video auf Startseite sichtbar ist */
body.theme-landing { background: transparent; }

body.theme-christmas { background: url('assets/Weihnachten_bg.jpg') no-repeat center center fixed; background-size: cover; }
body.theme-birthday { background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('assets/Geburtstag_bg.jpg') no-repeat center center fixed; background-size: cover; } 
body.theme-wedding { background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('assets/Hochzeitstag_bg.jpg') no-repeat center center fixed; background-size: cover; } 
body.theme-default { background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('assets/Allgemeine-Wunschliste.jpg') no-repeat center center fixed; background-size: cover; }

#video-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; overflow: hidden; }
.video-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); z-index: -1; pointer-events: none; }
#bg-video { min-width: 100%; min-height: 100%; object-fit: cover; transition: opacity 0.5s ease; }

.hero-section { min-height: 100vh; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px 0; }
.card { background: rgba(255, 255, 255, 0.9); padding: 2rem; border-radius: 25px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); text-align: center; max-width: 460px; width: 90%; z-index: 10; position: relative; }

.app-header { position: relative; min-height: 40px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.app-header h2 { margin: 0; font-size: 1.5rem; color: var(--primary); width: 100%; text-align: center; line-height: 1.2; }
.header-sub { font-size: 0.9rem; color: #718096; font-weight: 400; display: block; margin-top: 2px; }

.header-actions { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; z-index: 10; }

.cart-badge { position: relative; right: auto; top: auto; transform: none; background: #2d3748; color: white; padding: 6px 12px; border-radius: 20px; font-weight: bold; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s; white-space: nowrap; }
.cart-badge:hover { background: #1a202c; }
.cart-badge.active { background: var(--success); }
.cart-badge.pulse { animation: pulse 0.4s ease-in-out; background: var(--success); }

.drag-handle { 
    cursor: grab; 
    color: #cbd5e0; 
    font-size: 1.2rem; 
    padding: 0 10px 0 0; 
    display: flex; 
    align-items: center; 
    user-select: none; 
}
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.4; background: #edf2f7; }

.icon-btn-header { cursor: pointer; font-size: 1.2rem; transition: transform 0.2s; }
.icon-btn-header:hover { transform: rotate(45deg); }

@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

.calendar-trigger { cursor: pointer; border-bottom: 1px dashed #a0aec0; transition: all 0.2s; padding-bottom: 1px; }
.calendar-trigger:hover { color: var(--primary); border-bottom-color: var(--primary); }

.secure-area { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; text-align: center; }
.btn-secure { background: #6b46c1; color: white; padding: 12px; width: 100%; border-radius: 10px; font-size: 0.95rem; box-shadow: 0 4px 6px rgba(107, 70, 193, 0.2); border: none; }
.btn-secure:hover { background: #553c9a; }

.seo-content { background: rgba(255, 255, 255, 0.95); max-width: 900px; width: 90%; padding: 40px; border-radius: 15px; margin-top: 20px; text-align: left; color: #2d3748; font-size: 1rem; line-height: 1.6; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.seo-content h2 { color: var(--primary); margin-top: 0; text-align: center; font-size: 2rem; }
.seo-intro { text-align: center; margin-bottom: 40px; color: #4a5568; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 40px; }
.feature-item { text-align: center; padding: 20px; background: #f8fafc; border-radius: 12px; border: 1px solid #edf2f7; transition: transform 0.3s; }
.feature-item:hover { transform: translateY(-5px); }
.feature-icon { font-size: 2.5rem; margin-bottom: 15px; display: block; }
.feature-title { font-weight: bold; margin-bottom: 10px; display: block; color: #2d3748; }

.faq-section { margin-top: 40px; }
.faq-section h3 { text-align: center; color: #2d3748; margin-bottom: 20px; }
details { background: #f8fafc; border-radius: 8px; padding: 15px; margin-bottom: 10px; border: 1px solid #edf2f7; cursor: pointer; }
summary { font-weight: bold; color: #2d3748; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: '+'; font-size: 1.2rem; font-weight: bold; }
details[open] summary::after { content: '−'; }
details p { margin: 10px 0 0 0; color: #4a5568; font-size: 0.95rem; }

h1 { font-family: 'Mountains of Christmas', cursive; font-size: 3rem; color: var(--primary); margin: 0; cursor: pointer; line-height: 1.1; }
.tagline { font-family: 'Inter', sans-serif; font-size: 0.9rem; color: #718096; margin-top: 5px; margin-bottom: 30px; font-weight: 400; }

input, select, button, textarea { padding: 12px; margin: 5px 0; width: 100%; border-radius: 10px; border: 1px solid #ddd; font-family: inherit; transition: border-color 0.3s, box-shadow 0.3s; }
button { background: var(--primary); color: white; border: none; font-weight: bold; cursor: pointer; transition: transform 0.1s, background 0.3s; }
button:active { transform: scale(0.98); }
button:disabled { background: #ccc; cursor: not-allowed; }

/* ERROR STATE: Visuelles Feedback statt Alert */
.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.2); /* Sanfter roter Schein */
    animation: shake 0.3s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.wish-item { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 15px; margin: 10px 0; border-radius: 12px; border: 1px solid #eee; text-align: left; transition: opacity 0.3s; }
.wish-item.reserved { background: #f1f5f9; opacity: 0.7; }
.wish-item.hidden { display: none; }

.item-actions { display: flex; align-items: center; gap: 10px; }

.btn-amazon { padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; display: inline-block; text-align: center; text-decoration: none; color: white; background: var(--amazon); }
.btn-reserve { padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; display: inline-block; text-align: center; text-decoration: none; color: white; background: #4a5568; }
.btn-add-item { background: transparent; border: 2px solid var(--success); color: var(--success); }
.btn-add-item:hover { background: var(--success); color: white; }

.btn-trash { background: none; border: none; padding: 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #a0aec0; transition: color 0.2s; }
.btn-trash:hover { color: #e53e3e; }
.btn-trash svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.error-box { background: #fff5f5; color: var(--error); border: 1px solid #feb2b2; padding: 10px; border-radius: 8px; margin-bottom: 15px; }

.filter-container { display: flex; align-items: center; justify-content: center; margin-bottom: 15px; gap: 10px; background: #f4f7f6; padding: 10px; border-radius: 15px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(18px); }

.tab-nav { display: flex; justify-content: center; gap: 5px; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.tab-btn { background: none; border: none; padding: 8px 15px; font-size: 0.9rem; color: #718096; cursor: pointer; font-weight: bold; border-bottom: 3px solid transparent; border-radius: 0; width: auto; transition: 0.3s; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: none; }

.tab-content-wrapper { display: grid; grid-template-areas: "stack"; }
.tab-pane { grid-area: stack; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; pointer-events: none; }
.tab-pane.active { opacity: 1; visibility: visible; pointer-events: auto; z-index: 1; }

.trend-container { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.trend-badge { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 8px 15px; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.trend-badge:hover { background: #edf2f7; transform: translateY(-1px); border-color: #cbd5e0; }
.trend-meta { font-size: 0.7rem; color: #718096; background: #edf2f7; padding: 2px 6px; border-radius: 8px; margin-left: 5px; }

.ai-area { background: #e3f2fd; padding: 15px; border-radius: 15px; border: 2px dashed #90caf9; text-align: left; }
.ai-btn { background: linear-gradient(45deg, #667eea, #764ba2); color: white; border: none; font-size: 0.8rem; margin-top: 10px; width: 100%; border-radius: 8px; }
.ai-chip { display: inline-block; background: white; color: #333; padding: 8px 15px; border-radius: 20px; margin: 3px; font-size: 0.85rem; cursor: pointer; border: 1px solid #ddd; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.ai-chip:hover { transform: translateY(-2px); border-color: #667eea; color: #667eea; }
.ai-chip.added { background: #c6f6d5; border-color: #48bb78; color: #2f855a; pointer-events: none; }

#view-shop { display: block; }
#view-cart { display: none; }

#particle-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.particle { position: absolute; user-select: none; }
@keyframes rise { 0% { transform: translateY(110vh) rotate(0deg); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-10vh) rotate(20deg); opacity: 0; } }

.onboarding-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 999; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.onboarding-card { background: white; width: 90%; max-width: 400px; padding: 30px; border-radius: 20px; text-align: center; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.3); animation: popIn 0.4s; }
.onboarding-icon { font-size: 3rem; margin-bottom: 10px; display: block; }
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.cal-btn { display:block; width:100%; padding:15px; margin-bottom:10px; border-radius:10px; border:none; cursor:pointer; font-weight:bold; font-size:1rem; text-align:center; text-decoration:none; }
.btn-google { background: #4285F4; color: white; }
.btn-ics { background: #2d3748; color: white; }

#share-view { display: none; text-align: center; }
.big-share-btn { background: #2d3748; padding: 15px; font-size: 1rem; margin-bottom: 15px; width: 100%; }
#btn-native-share { background: var(--share); margin-bottom: 15px; display: none; }
.finish-btn { background: #28a745; margin-top: 20px; font-size: 1.1rem; padding: 15px; box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3); color: white;}

.legal-footer { padding: 20px; background: rgba(0,0,0,0.5); width: 100%; text-align: center; color: #ccc; font-size: 0.75rem; margin-top: auto; }
.legal-footer a { color: #fff; text-decoration: none; margin: 0 10px; }

/* --- DESKTOP TWEAK: Custom Arrow --- */
@media (min-width: 769px) {
    select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        /* Eigener SVG Pfeil */
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        /* Position: 12px vom Rand (gleicher Abstand wie das Padding der Eingabe) */
        background-position: right 12px center;
        background-size: 16px;
        padding-right: 40px; /* Platz für den Pfeil reservieren */
        cursor: pointer;
    }
}

.mobile-onboarding { display: none; }

@media (max-width: 768px) {
    body, body.theme-christmas, body.theme-birthday, body.theme-wedding, body.theme-default {
        background: #ffffff !important; 
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .seo-section, .legal-footer, #particle-layer, #video-container, .video-overlay { 
        display: none !important; 
    }
    .hero-section {
        padding: 0;
        height: 100%;
        width: 100%;
        display: flex;
        flex: 1;
        overflow: hidden;
    }
    .card {
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
        padding: 20px 25px;
        box-sizing: border-box !important;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    h1 { 
        font-size: 13vw; 
        line-height: 1.1; 
        margin-top: 20px; 
        margin-bottom: 10px; 
    }
    
    .mobile-onboarding {
        display: flex;
        flex-direction: column;
        flex-grow: 1; 
        justify-content: flex-end; 
        margin-top: 20px;
        text-align: left;
    }
    .mobile-onboarding .steps {
        margin-top: auto;
        margin-bottom: auto;
        color: #4a5568;
        font-size: 0.95rem;
        line-height: 1.8;
    }
    .mobile-onboarding .steps p { margin: 10px 0; }
    
    .mobile-legal {
        margin-top: auto;
        text-align: center;
        font-size: 0.75rem;
        color: #a0aec0;
        padding-top: 20px;
        padding-bottom: 10px;
    }
    .mobile-legal a { color: #a0aec0; text-decoration: none; }
    
    body { font-size: 16px; } 
    input, select, button, textarea { font-size: 16px !important; padding: 14px !important; }
    .tab-btn { padding: 12px 5px; font-size: 1rem; flex: 1; }
    .tab-nav { gap: 2px; }
    .wish-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 15px; }
    .wish-item strong { font-size: 1.15rem; display: block; margin-bottom: 4px; }
    .item-actions { width: 100%; justify-content: space-between; display: flex; gap: 10px; margin-top: 5px; }
    .btn-amazon, .btn-reserve { flex: 1; padding: 12px 0; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
    .btn-trash { padding: 0; width: 44px; height: 44px; background: #fee; border-radius: 8px; border: 1px solid #fed7d7; }
    .btn-trash svg { width: 24px; height: 24px; stroke: #e53e3e; }
    .ai-chip { padding: 10px 15px; font-size: 1rem; margin: 5px 3px; }
    .trend-badge { padding: 12px 18px; font-size: 1rem; }

    /* --- MOBILE HEADER FIX (Option A) --- */
    .app-header {
        justify-content: space-between;
        padding: 0 5px;
    }
    .app-header h2 {
        text-align: left;
        width: auto;
        flex: 1;
        padding-right: 15px;
        font-size: 1.3rem; 
    }
    .header-actions {
        position: static;
        transform: none;
        right: auto;
        top: auto;
        flex-shrink: 0;
    }
    .header-sub {
        text-align: left;
        display: block;
    }
}