:root {
    --primary-color: #FF7E5F;
    --primary-gradient: linear-gradient(135deg, #FF7E5F 0%, #FEB47B 100%);
    --bg-color: #FDFBF7;
    --surface-color: #FFFFFF;
    --text-main: #2C3E50;
    --text-muted: #7F8C8D;
    --border-color: #EAE2D6;
    --accent-blue: #4A90E2;
    --success-color: #4CAF50;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #F0EDE5; 
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; 
}

#app-container {
    width: 100%;
    max-width: 420px;
    height: 100dvh;
    max-height: 900px;
    background-color: var(--bg-color);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    padding: 24px 20px 16px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#app-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 80px; 
}

#bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    gap: 4px;
}

.nav-item span.icon {
    font-size: 28px;
}

.nav-item.active {
    color: var(--primary-color);
}

.family-card {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.family-card:active {
    transform: scale(0.98);
}

.card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 24px;
    background: var(--primary-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    margin-right: 12px;
}

.family-info h3 {
    font-size: 18px;
    margin-bottom: 2px;
}
.family-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Matching Badge */
.match-badge {
    background: #E8F5E9;
    color: var(--success-color);
    min-width: 50px;
    padding: 6px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.match-badge .score {
    font-weight: 800;
    font-size: 16px;
}
.match-badge .label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #FFF0D1;
    color: #D3741C;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.tag-kid {
    background: #E8F4FD;
    color: var(--accent-blue);
}

.tag-match {
    background: #E8F5E9;
    color: var(--success-color); /* Grüne Tönung für gemeinsame Interessen */
}

/* Form Styling */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 126, 95, 0.3);
    transition: transform 0.1s ease;
}

.btn-primary:active {
    transform: scale(0.98);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

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

/* Landing Page Styles */
body.state-logged-out header,
body.state-logged-out #bottom-nav {
    display: none;
}
body.state-logged-out #app-content {
    padding: 0;
    max-height: 100%;
}

.landing-page {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.hero-image {
    min-height: 240px;
    flex: 0 0 clamp(240px, 35vh, 400px);
    background-size: cover;
    background-position: center top;
    border-radius: 36px;
    margin: 16px 16px 0 16px;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
}
.landing-content {
    flex: 1 0 auto;
    padding: clamp(20px, 4vh, 32px) 24px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
}
.btn-large {
    padding: 18px 30px;
    font-size: 18px;
    box-shadow: 0 8px 16px rgba(255, 126, 95, 0.4);
}

@media (max-height: 760px) {
    .hero-image {
        min-height: 200px;
        flex: 0 0 200px;
        margin: 12px 12px 0 12px;
        border-radius: 28px;
    }
    .landing-content {
        padding: 16px 20px 10px;
        gap: 8px;
    }
}
