/* Grunddesign: Hell & Frisches Blau */
body {
    margin: 0; padding: 0;
    font-family: '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff; color: #1e293b;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; 
}

:root {
    --primary-blue: #3b82f6; 
    --gradient-blue: linear-gradient(135deg, #60a5fa, #3b82f6);
}

/* FIX: Bombenfester Rahmen */
#main-app {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column; background-color: #ffffff;
}

.hidden { display: none !important; }

/* AUTHENTIFIZIERUNG / LOGIN SCREEN */
.auth-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    display: flex; justify-content: center; align-items: center; z-index: 2000;
}
.auth-container {
    width: 85%; max-width: 360px; background-color: #ffffff;
    padding: 30px 20px; border-radius: 24px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15); border: 1px solid #e2e8f0; text-align: center;
}
.auth-logo { font-size: 26px; font-weight: bold; color: var(--primary-blue); margin-bottom: 20px; }
.auth-container h3 { margin: 0 0 20px 0; color: #0f172a; font-size: 20px; }
.auth-toggle { margin-top: 20px; font-size: 14px; color: #64748b; }
#auth-toggle-btn {
    background: none; border: none; color: var(--primary-blue);
    font-weight: bold; cursor: pointer; padding: 0; margin-left: 5px; text-decoration: underline;
}
.privacy-check { display: flex; align-items: flex-start; gap: 8px; text-align: left; margin-top: 15px; margin-bottom: 5px; font-size: 12px; color: #475569; }
.privacy-check a { color: var(--primary-blue); font-weight: bold; text-decoration: none; }

/* DATENSCHUTZ MODAL */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.6); display: flex;
    justify-content: center; align-items: center; z-index: 3000;
}
.modal-content {
    background-color: white; width: 85%; max-width: 400px; max-height: 80vh;
    border-radius: 20px; padding: 20px; display: flex; flex-direction: column;
}
.modal-content h3 { margin-top: 0; color: var(--primary-blue); }
.modal-text { overflow-y: auto; font-size: 14px; line-height: 1.5; color: #475569; margin-bottom: 15px; padding-right: 5px; }

.form-label { display: block; text-align: left; font-size: 13px; font-weight: bold; color: var(--primary-blue); margin-top: 12px; margin-left: 4px; }

/* KOPFZEILE (HEADER) */
header {
    background-color: #ffffff; color: #1e293b; display: flex; flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); z-index: 10; border-bottom: 1px solid #f1f5f9;
}
.header-top {
    display: flex; justify-content: center; align-items: center;
    padding: 15px; height: 30px; position: relative;
}
.logo { font-size: 22px; font-weight: bold; color: var(--primary-blue); }
.back-btn { background: none; border: none; color: var(--primary-blue); font-size: 16px; font-weight: bold; cursor: pointer; padding: 0; position: absolute; left: 15px; z-index: 20; }
#open-menu-btn { background: none; border: none; color: var(--primary-blue); font-size: 28px; cursor: pointer; padding: 0; position: absolute; right: 15px; z-index: 20; }
.header-search { padding: 0 15px 15px 15px; }
.header-search input {
    width: 100%; padding: 12px; border-radius: 14px; border: 1px solid #e2e8f0;
    background-color: #f8fafc; color: #1e293b; outline: none; font-size: 16px;
    box-sizing: border-box; box-shadow: inset 0 1px 3px rgba(0,0,0,0.02); transition: border-color 0.2s;
}
.header-search input:focus { border-color: var(--primary-blue); }

/* HAUPTBEREICH */
main {
    flex: 1; overflow-y: auto; padding: 15px; position: relative;
    background-color: var(--dynamic-bg, #ffffff); transition: background-color 0.6s ease;
}

/* KARTEN */
.card {
    background-color: #ffffff; border-radius: 20px; padding: 20px; margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04); border: 1px solid #f1f5f9;
}
.card.text-center { text-align: center; }
.card h3 { margin-top: 0; margin-bottom: 10px; color: #0f172a; }
.card p { margin: 0; color: #64748b; line-height: 1.6; }

/* GALERIE & LISTEN */
.section-title { font-weight: 700; margin-bottom: 12px; color: #0f172a; font-size: 18px; }
.horizontal-scroll {
    display: flex; overflow-x: auto; gap: 15px; padding-bottom: 12px;
    margin-bottom: 10px; scroll-snap-type: x mandatory;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }
.favorites-grid { display: flex; flex-direction: column; gap: 15px; padding-bottom: 20px; }

.listing-card {
    background-color: #ffffff; min-width: 220px; max-width: 100%; border-radius: 20px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); scroll-snap-align: start; border: 1px solid #e2e8f0;
    cursor: pointer; display: flex; flex-direction: column; overflow: hidden; transition: transform 0.2s;
}
.listing-image { width: 100%; height: 140px; position: relative; display: flex; justify-content: center; align-items: center; background-size: cover; background-position: center; }
.img-placeholder { color: rgba(255,255,255,0.7); font-weight: bold; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

/* Like-Badge */
.like-badge {
    position: absolute; top: 10px; right: 10px; background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px); border: none; border-radius: 20px; padding: 6px 10px;
    display: flex; align-items: center; gap: 5px; color: white; font-weight: bold;
    font-size: 12px; cursor: pointer; z-index: 5; transition: background-color 0.2s, transform 0.1s;
}
.like-badge.liked { background-color: rgba(239, 68, 68, 0.9); }

.listing-details { padding: 15px; }
.listing-details h4 { margin: 0 0 6px 0; color: var(--primary-blue); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-details p { margin: 0 0 10px 0; font-size: 13px; color: #64748b; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing-price { font-weight: bold; color: #0f172a; font-size: 16px; }


/* NEU: DETAIL-ANSICHT DES INSERATS */
.detail-slider {
    margin: -15px -15px 15px -15px; /* Zieht den Slider bis an den Rand des Bildschirms */
    padding: 0; gap: 0; scroll-snap-type: x mandatory;
}
.detail-slide-img {
    min-width: 100vw; height: 300px; background-size: cover; background-position: center;
    scroll-snap-align: start; position: relative;
}
.detail-content-card {
    margin-top: -30px; /* Zieht die weiße Karte leicht über das Bild für einen 3D Effekt */
    border-top-left-radius: 24px; border-top-right-radius: 24px;
    position: relative; z-index: 2; padding-top: 30px;
}


/* FORMULARE */
.input-field {
    width: 100%; padding: 14px; margin-top: 8px; border: 1px solid #e2e8f0;
    background-color: #f8fafc; color: #1e293b; border-radius: 14px; font-size: 16px;
    box-sizing: border-box; outline: none; transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--primary-blue); background-color: #ffffff; }

.image-upload-box {
    width: 100%; border: 2px dashed var(--primary-blue); background-color: #eff6ff;
    border-radius: 14px; padding: 35px 0; text-align: center; margin-top: 15px;
    color: var(--primary-blue); font-weight: bold; cursor: pointer; overflow: hidden;
}

.submit-btn {
    width: 100%; background: var(--gradient-blue); color: white; border: none;
    padding: 16px; border-radius: 14px; font-size: 16px; font-weight: bold; margin-top: 15px;
    cursor: pointer; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* CHAT */
.chat-container { background-color: #ffffff; border-radius: 24px; display: flex; flex-direction: column; height: 70vh; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04); border: 1px solid #f1f5f9; overflow: hidden; }
.chat-header { background-color: #f8fafc; padding: 15px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #e2e8f0; }
.chat-user-avatar { width: 40px; height: 40px; background-color: #e2e8f0; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 20px; }
.chat-user-name { display: block; font-weight: bold; color: #0f172a; }
.chat-user-status { font-size: 12px; color: #22c55e; font-weight: bold; }
.chat-messages { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 12px; background-color: #fdfdfd; }
.message { max-width: 75%; padding: 12px 16px; border-radius: 18px; font-size: 15px; position: relative; }
.message p { margin: 0; }
.message-time { display: block; font-size: 10px; color: #94a3b8; text-align: right; margin-top: 4px; }
.message.incoming { background-color: #f1f5f9; color: #1e293b; align-self: flex-start; border-top-left-radius: 4px; }
.message.outgoing { background: var(--gradient-blue); color: white; align-self: flex-end; border-top-right-radius: 4px; }
.message.outgoing .message-time { color: #eff6ff; }
.chat-input-area { padding: 12px; background-color: #ffffff; border-top: 1px solid #e2e8f0; display: flex; gap: 10px; }
.chat-input-area input { flex: 1; padding: 12px; border: 1px solid #e2e8f0; background-color: #f8fafc; border-radius: 14px; outline: none; font-size: 15px; }
#chat-send-btn { background-color: var(--primary-blue); color: white; border: none; width: 45px; height: 45px; border-radius: 14px; font-size: 18px; cursor: pointer; }

/* ZAHLUNG */
.premium-badge { background-color: #eff6ff; color: var(--primary-blue); font-weight: 800; font-size: 12px; padding: 6px 16px; border-radius: 20px; display: inline-block; margin-bottom: 10px; }
.price-tag { font-size: 36px; font-weight: 900; color: var(--primary-blue); margin: 20px 0; }
.price-tag span { font-size: 16px; color: #64748b; font-weight: normal; }
.benefit-list { list-style: none; padding: 0; margin: 0; text-align: left; max-width: 260px; margin: 0 auto; }
.benefit-list li { padding: 8px 0; color: #475569; font-size: 15px; }

/* SEITENMENÜ */
#side-menu { position: fixed; top: 0; right: 0; width: 280px; height: 100%; background-color: #ffffff; box-shadow: -4px 0 30px rgba(0,0,0,0.08); z-index: 1000; transition: transform 0.3s ease-in-out; display: flex; flex-direction: column; border-left: 1px solid #e2e8f0; }
.menu-closed { transform: translateX(100%); }
.menu-open { transform: translateX(0); }
.menu-header { background-color: #f8fafc; color: #0f172a; padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; }
.menu-header h2 { margin: 0; font-size: 20px; }
#close-menu-btn { background: none; border: none; color: #64748b; font-size: 20px; cursor: pointer; }
.menu-profile { padding: 20px; text-align: center; border-bottom: 1px solid #e2e8f0; }
.avatar-placeholder { width: 80px; height: 80px; background-color: #f1f5f9; border-radius: 50%; margin: 0 auto 12px auto; display: flex; justify-content: center; align-items: center; font-size: 30px; border: 2px solid var(--primary-blue); overflow: hidden; }
.avatar-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn { background: none; border: 1px solid var(--primary-blue); color: var(--primary-blue); padding: 6px 12px; border-radius: 10px; cursor: pointer; font-weight: bold; }
.menu-links { list-style: none; padding: 0; margin: 0; }
.menu-links li { border-bottom: 1px solid #f1f5f9; }
.menu-item, .menu-item-link { display: block; padding: 15px 20px; text-decoration: none; color: #334155; font-size: 16px; cursor: pointer; }
.menu-item:hover, .menu-item-link:hover { background-color: #f8fafc; }
#menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.3); z-index: 999; }

/* UNTERE NAVIGATION */
nav {
    background-color: #ffffff; border-top: 1px solid #f1f5f9; display: flex;
    justify-content: space-around; padding: 10px 0; padding-bottom: env(safe-area-inset-bottom, 10px);
    z-index: 10; box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}

nav button {
    background: none; border: none; font-size: 11px; color: #64748b;
    display: flex; flex-direction: column; align-items: center; cursor: pointer; flex: 1; 
}
nav button span { font-size: 22px; margin-bottom: 4px; }
.insert-btn span { color: var(--primary-blue); font-size: 28px; margin-top: -4px; }
nav button.active { color: var(--primary-blue); font-weight: bold; }
.wss-icon { font-weight: 900; font-style: italic; color: var(--primary-blue); font-size: 16px !important; margin-bottom: 4px; letter-spacing: -1px; display: inline-block; }