/* ============================================================
   FamilyBot – Haupt-Stylesheet (Mobile First)
   ============================================================ */

/* --- Reset & Grundlagen --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #4A90D9;
    --primary-dark: #3A7BC8;
    --primary-light: #E8F0FE;
    --success: #34A853;
    --warning: #F9AB00;
    --danger: #EA4335;
    --text: #333;
    --text-light: #666;
    --bg: #F5F7FA;
    --white: #FFF;
    --border: #DDD;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Container --- */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* --- Header --- */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}
.logo:hover { text-decoration: none; }

.main-nav { display: none; gap: 20px; }
.main-nav a { color: var(--text); font-size: 0.95rem; }
.main-nav a:hover { color: var(--primary); text-decoration: none; }

.nav-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

/* Kommentar-Badge (Sprechblase) */
.comment-badge {
    display: inline-block;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.4;
}

/* Header-Profilbild */
.header-profile span { display: none; }
@media (min-width: 768px) {
    .header-profile span { display: inline; }
}

/* Nav offen (per JS) */
.main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

/* --- Main --- */
main.container {
    flex: 1;
    padding-top: 24px;
    padding-bottom: 40px;
}

/* --- Footer --- */
.app-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* --- Flash-Nachrichten --- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.flash-success { background: #E6F4EA; color: #1E7E34; border: 1px solid #B7E1CD; }
.flash-error { background: #FDE7E9; color: #C62828; border: 1px solid #F5C6CB; }
.flash-warning { background: #FFF8E1; color: #856404; border: 1px solid #FFE082; }
.flash-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #B3D4FC; }

/* --- Karten / Panels --- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* --- Auth-Layout (Login, Register) --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    width: 100%;
    max-width: 420px;
}
.auth-card h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 8px;
    color: var(--primary);
}
.auth-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* --- Formulare --- */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

/* --- Landingpage: Hero --- */
.hero {
    text-align: center;
    padding: 60px 16px 48px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
}
.hero h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.3;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Landingpage: Features --- */
.features {
    padding: 48px 16px;
}
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.feature-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}
.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}
.feature-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* --- Links unter Formularen --- */
.auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
}
.auth-links a { margin: 0 8px; }

/* --- Tabellen --- */
.table-responsive { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th { font-weight: 600; background: var(--bg); }

/* ============================================================
   Desktop (ab 768px)
   ============================================================ */
@media (min-width: 768px) {
    .main-nav {
        display: flex !important;
        position: static;
        flex-direction: row;
        background: none;
        padding: 0;
        box-shadow: none;
        border: none;
        margin-left: auto;
        margin-right: 16px;
    }
    .nav-toggle { display: none; }
    .container { padding: 0 24px; }
    .auth-card { padding: 40px; }
    .hero h1 { font-size: 2.4rem; }
    .hero { padding: 80px 24px 64px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .features-grid { grid-template-columns: repeat(4, 1fr); }
}


/* --- Lightbox (generell wiederverwendbar) --- */
.lightbox-trigger {
    cursor: pointer;
    transition: opacity 0.2s;
}
.lightbox-trigger:hover {
    opacity: 0.8;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-wrapper {
    position: relative;
    transform: scale(0.92);
    transition: transform 0.3s;
}
.lightbox-overlay.active .lightbox-wrapper {
    transform: scale(1);
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 6px;
    border: 3px solid #fff;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    font-size: 1.4rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #fff;
    transition: background 0.2s;
    z-index: 1;
}
.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* --- Feature Tour / Slideshow --- */
.tour-section {
    padding: 48px 16px 56px;
    background: var(--white);
}
.tour-section h2 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--text);
}
.tour-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 32px;
}
.tour-slider {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}
.tour-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.tour-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
}
.tour-mockup {
    background: var(--bg);
    padding: 24px 20px 20px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}
.tour-mockup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--white);
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 12px;
}
.tour-mockup-header .dot {
    width: 8px; height: 8px; border-radius: 50%;
}
.tour-mockup-header .dot-r { background: #EA4335; }
.tour-mockup-header .dot-y { background: #F9AB00; }
.tour-mockup-header .dot-g { background: #34A853; }
.tour-mockup-header .title {
    font-size: 0.8rem; font-weight: 600; color: var(--primary); margin-left: 4px;
}
.tour-mockup-body {
    flex: 1;
    background: var(--white);
    border-radius: 0 0 8px 8px;
    padding: 16px;
}
.tour-info {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}
.tour-info h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}
.tour-info p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.5;
}
.tour-step {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
}

/* Slideshow Buttons */
.tour-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.tour-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}
.tour-btn-prev { left: 10px; }
.tour-btn-next { right: 10px; }

/* Dots */
.tour-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.tour-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    padding: 0;
}
.tour-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}

/* Mockup Helper Styles */
.m-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.m-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.m-bar { height: 8px; border-radius: 4px; background: #e9ecef; }
.m-bar-fill { height: 100%; border-radius: 4px; }
.m-badge { font-size: 0.65rem; padding: 2px 6px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.m-input { background: #f0f0f0; border-radius: 6px; padding: 6px 10px; font-size: 0.75rem; color: var(--text-light); border: 1px solid var(--border); }
.m-check { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.m-check.done { background: var(--success); border-color: var(--success); }
.m-card { background: var(--bg); border-radius: 6px; padding: 8px 10px; font-size: 0.75rem; }
.m-cal-cell { text-align: center; padding: 4px; font-size: 0.65rem; border-radius: 4px; }
.m-pin { background: #fff3e0; border-left: 3px solid #ff8c00; border-radius: 6px; padding: 6px 10px; font-size: 0.75rem; }

@media (min-width: 768px) {
    .tour-section { padding: 64px 24px 72px; }
    .tour-section h2 { font-size: 1.8rem; }
    .tour-mockup { min-height: 320px; padding: 28px 24px 24px; }
    .tour-btn { width: 44px; height: 44px; }
}
