/* ============================================
   RV Hoya PWA – Mobile First Stylesheet
   ============================================ */

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --primary-dark: #0e3a54;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --bg: #f0f2f5;
    --white: #ffffff;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --nav-height: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    padding-bottom: calc(var(--nav-height) + 16px);
    min-height: 100vh;
}

/* ---- Typography ---- */

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

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

/* ---- Hero / Header Image ---- */

.hero {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--primary);
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider {
    position: absolute;
    inset: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}


.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 20px 16px;
}

.hero-overlay h1 {
    color: var(--white);
    font-size: 1.6rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-overlay .hero-sub {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ---- Page Header ---- */

.page-header {
    background: var(--primary);
    color: var(--white);
    padding: 16px;
    padding-top: max(env(safe-area-inset-top, 0px), 16px);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header h1 {
    font-size: 1.15rem;
    flex: 1;
}

.page-header .back-btn {
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
}

.page-header .back-btn svg {
    width: 20px;
    height: 20px;
}

/* ---- Section ---- */

.section {
    padding: 16px;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title .see-all {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-light);
}

/* ---- Quick Actions Grid ---- */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
}

.quick-action-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.quick-action-icon svg {
    width: 24px;
    height: 24px;
}

.quick-action:active .quick-action-icon {
    transform: scale(0.92);
}

.quick-action span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.quick-action-icon.news-icon { background: #2980b9; }
.quick-action-icon.events-icon { background: #27ae60; }
.quick-action-icon.club-icon { background: #8e44ad; }
.quick-action-icon.contact-icon { background: #e67e22; }

/* ---- Cards ---- */

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 12px;
    transition: transform 0.15s;
}

.card:active {
    transform: scale(0.98);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 14px 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.card-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

/* ---- Contact / Ansprechpartner Cards ---- */

.contact-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.contact-avatar svg {
    width: 24px;
    height: 24px;
}

.contact-avatar-photo {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.contact-avatar-photo:active {
    transform: scale(0.92);
}

.contact-avatar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Photo Lightbox ---- */

.photo-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
    cursor: pointer;
}

.photo-lightbox-content {
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
    cursor: default;
}

.photo-lightbox-content img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.photo-lightbox-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 600;
    margin-top: 16px;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-role {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 2px;
}

.contact-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.contact-name.contact-vacant {
    font-weight: 400;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--primary-light);
    text-decoration: none;
    margin-top: 4px;
    word-break: break-all;
}

.contact-detail svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---- Install Overlay (Jellyseerr-style) ---- */

.install-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.install-overlay-card {
    background: var(--white);
    border-radius: 20px;
    padding: 36px 28px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
}

.install-overlay-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--primary);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(26, 82, 118, 0.3);
}

.install-overlay-icon img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.install-overlay-card h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text);
}

.install-overlay-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.install-overlay-card .install-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.install-overlay-card .btn-install {
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    background: var(--primary);
    color: var(--white);
    transition: transform 0.15s;
}

.install-overlay-card .btn-install:active {
    transform: scale(0.96);
}

.install-overlay-card .btn-later {
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font);
}

.install-overlay-card .btn-later:hover {
    color: var(--text);
}

.install-overlay-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.install-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.install-feature svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.install-feature span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ---- News Card Horizontal ---- */

.news-card-h {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s;
}

.news-card-h:active {
    transform: scale(0.98);
}

.news-card-h .thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--border);
}

.news-card-h .info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.news-card-h .info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-h .info .meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- Badge ---- */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-primary { background: var(--primary); color: var(--white); }
.badge-accent { background: var(--accent); color: var(--white); }
.badge-success { background: var(--success); color: var(--white); }
.badge-warning { background: var(--warning); color: var(--white); }
.badge-external { background: #6c5ce7; color: var(--white); }

/* ---- Event Cards ---- */

.event-card {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.event-card-expandable {
    display: block;
    padding: 0;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.event-card-expandable.expanded {
    box-shadow: var(--shadow-lg);
}

.event-card-header {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    align-items: flex-start;
}

.event-chevron {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 4px;
}

.event-chevron svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.event-card-expandable.expanded .event-chevron svg {
    transform: rotate(180deg);
}

.event-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 4px 0;
}

.event-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    border-top: 0 solid var(--border);
    padding: 0 16px;
}

.event-card-expandable.expanded .event-details {
    max-height: 600px;
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
}

.event-map-container {
    margin-top: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.event-map {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-sm);
    z-index: 0;
}

.event-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.event-map .leaflet-control-attribution {
    font-size: 0.6rem;
    padding: 1px 5px;
    background: rgba(255,255,255,0.7) !important;
}

.event-map-marker {
    background: none !important;
    border: none !important;
}

.event-map-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.event-location-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-top: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s;
}

.event-location-link:active {
    background: var(--border);
}

.event-location-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-location-icon svg {
    width: 20px;
    height: 20px;
}

.event-location-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.event-location-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
}

.event-location-name {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-location-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.btn-add-calendar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-add-calendar svg {
    width: 18px;
    height: 18px;
}

.btn-add-calendar:active {
    background: var(--primary);
    color: var(--white);
    transform: scale(0.97);
}

.event-date-box {
    width: 50px;
    min-height: 56px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-date-box .day {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.event-date-box .month {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
}

.event-info {
    flex: 1;
    min-width: 0;
}

.event-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.event-info .event-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.event-info .event-meta svg {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 2px;
}

/* ---- Article Page ---- */

.article-hero {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.article-content {
    padding: 20px 16px;
}

.article-content h1 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.article-content .article-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-content .article-body {
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-content .article-body p {
    margin-bottom: 12px;
}

.article-content .article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    display: block;
}

.article-content .article-body h2,
.article-content .article-body h3 {
    margin: 16px 0 8px;
}

.article-content .article-body ul,
.article-content .article-body ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.article-content .article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content .article-body table td,
.article-content .article-body table th {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}

.article-content .article-body a {
    color: var(--primary-light);
    word-break: break-word;
}

.article-content .article-body * {
    max-width: 100%;
}

.article-content .article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Club Page ---- */

.club-info-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 16px;
    margin-bottom: 12px;
}

.club-info-card h3 {
    margin-bottom: 8px;
}

.club-info-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.club-info-card .info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.club-info-card .info-row:last-child {
    border-bottom: none;
}

.club-info-card .info-row svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ---- Mehr (More) Page ---- */

.menu-list {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: var(--bg);
}

.menu-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.menu-item .menu-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.menu-item .menu-arrow {
    color: var(--text-secondary);
    width: 16px;
    height: 16px;
}

/* ---- Bottom Navigation ---- */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 500;
    gap: 3px;
    transition: color 0.2s;
    position: relative;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

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

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
    text-decoration: none;
}

.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ---- Forms ---- */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font);
    background: var(--white);
    transition: border-color 0.15s;
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ---- Login Page ---- */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--primary);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 8px;
}

.login-card .login-sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-card .login-logo svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

/* ---- Alert / Flash ---- */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.alert-error { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ---- Install Banner ---- */

.install-banner {
    position: fixed;
    bottom: calc(var(--nav-height) + 8px);
    left: 12px;
    right: 12px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    padding: 12px 16px;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.install-banner-content span {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.install-banner .btn-sm {
    white-space: nowrap;
}

.install-banner .btn-outline {
    color: var(--white);
    border-color: rgba(255,255,255,0.3);
}

.hidden { display: none !important; }

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

/* ---- Loading ---- */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ---- Empty State ---- */

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

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ---- Pull to refresh indicator ---- */

.pull-indicator {
    text-align: center;
    padding: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ---- Tablet+ layout ---- */

@media (min-width: 768px) {
    .app-container {
        max-width: 480px;
        margin: 0 auto;
    }

    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    .install-banner {
        max-width: 456px;
        left: 50%;
        transform: translateX(-50%);
    }

    .hero { height: 280px; }
}

/* ============================================
   Admin Panel Styles
   ============================================ */

.admin-layout {
    padding-bottom: 20px;
}

.admin-header {
    background: var(--primary-dark);
    color: var(--white);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 1rem;
}

.admin-header a {
    color: var(--white);
    font-size: 0.85rem;
}

.admin-nav {
    display: flex;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-nav a {
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.admin-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-content {
    padding: 16px;
}

.admin-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
}

.admin-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.admin-card .card-header h3 {
    font-size: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    text-align: left;
    padding: 10px 8px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-actions {
    display: flex;
    gap: 6px;
}

.admin-actions .btn {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* ---- Ansprechpartner Admin Blocks ---- */

.ap-block {
    background: var(--bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.ap-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ap-block-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
}

.ap-block-actions {
    display: flex;
    gap: 2px;
}

.ap-btn-move {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 4px;
    color: var(--primary);
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.ap-btn-move svg {
    width: 16px;
    height: 16px;
}

.ap-btn-move:active {
    background: var(--primary);
    color: var(--white);
    transform: scale(0.9);
}

.ap-btn-delete {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 4px;
    color: var(--accent);
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.ap-btn-delete svg {
    width: 16px;
    height: 16px;
}

.ap-btn-delete:active {
    background: var(--accent);
    color: var(--white);
    transform: scale(0.9);
}

@keyframes apFlash {
    0% { background: rgba(26, 82, 118, 0.15); }
    100% { background: var(--bg); }
}

.ap-photo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ap-photo-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.ap-photo-preview svg {
    width: 28px;
    height: 28px;
}

.ap-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-photo-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ap-upload-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---- Responsive table wrapper ---- */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Modal ---- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--white);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.modal-header h3 {
    font-size: 1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.modal-body {
    padding: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---- No scrollbar for nav ---- */

.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- Skeleton loading ---- */

.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, #f5f5f5 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-image { height: 160px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Placeholder image ---- */
.img-placeholder {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
}

.img-placeholder svg {
    width: 40px;
    height: 40px;
}

/* ---- Floating action button (Admin) ---- */

.fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 500;
    transition: transform 0.15s;
}

.fab:active { transform: scale(0.9); }
.fab svg { width: 24px; height: 24px; }

/* ---- Chip / Tab Filters ---- */

.filter-chips {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
}

.chip.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
