/* zitiere.es – Custom Styles */

/* Android: System-Navigationsleiste (unten) an Bars-Farbe angleichen */
html.md {
    background-color: var(--f7-bars-bg-color, #FF8C00);
}

/* Desktop: App auf max. 800px begrenzen und zentrieren */
@media (min-width: 801px) {
    html, body {
        background: var(--ze-bg, #f7f7f8) !important;
    }
    #app {
        max-width: 800px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        position: relative;
    }
}

/* Nicht eingeloggt: Tabbar und Panel komplett ausblenden */
body.no-auth #main-tabbar,
body.no-auth .panel-left {
    display: none !important;
}

/*
 * Tabbar: F7 toolbar-pane für natives iOS Segmented-Tab-Design.
 * Smooth fade-out beim Wechsel auf Unterseiten.
 */
#main-tabbar {
    transition: opacity 0.5s ease;
    /* iOS PWA: Toolbar bis zum Bildschirmrand erweitern.
       F7 positioniert die Toolbar über dem Safe-Area-Bereich.
       Wir setzen bottom:0 + padding-bottom statt Abstand. */
    --f7-safe-area-bottom: 0px;
    bottom: 5px !important;
    height: auto !important;
    min-height: var(--f7-tabbar-icons-height, var(--f7-toolbar-height, 50px));
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}
html.md #main-tabbar {
    bottom: 0px !important;
}
#main-tabbar.tabbar-hidden {
    opacity: 0;
    pointer-events: none;
}
#main-tabbar .tab-link-highlight {
    bottom: 0;
    top: auto;
}
#main-tabbar .tabbar-label {
    font-size: 10px;
}

/* Floating Action Button */
#fab-create {
    position: fixed;
    bottom: calc(var(--f7-toolbar-height, 50px) + 34px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ze-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s ease;
}
#fab-create:active {
    transform: scale(0.92);
}
#fab-create i.icon {
    font-size: 28px;
}
body.no-auth #fab-create {
    display: none !important;
}

/* Gruppen-Avatar in der Navbar */
.navbar-group-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ze-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
}

:root {
    --ze-primary: #FF8C00;
    --ze-primary-dark: #E67E00;
    --ze-primary-light: #FFB347;
    --ze-bg: #f7f7f8;
    --ze-card-bg: #ffffff;
    --ze-text: #1a1a1a;
    --ze-text-secondary: #8e8e93;
    --ze-border: #e5e5ea;
    --ze-upvote: #FF8C00;
    --ze-downvote: #5856d6;
    --ze-success: #34c759;
    --ze-danger: #ff3b30;
}

.theme-dark {
    --ze-bg: #1c1c1e;
    --ze-card-bg: #2c2c2e;
    --ze-text: #ffffff;
    --ze-text-secondary: #98989f;
    --ze-border: #38383a;
}

/* Framework7 Farbüberschreibungen */
:root {
    --f7-theme-color: #FF8C00;
    --f7-theme-color-rgb: 255, 140, 0;
    --f7-theme-color-shade: #E67E00;
    --f7-theme-color-tint: #FFB347;
}

/* Login-Seite */
[data-name="login"] .page-content .login-logo {
    text-align: center;
    padding: 20px 0;
}
[data-name="login"] .page-content .login-logo img {
    width: 120px;
    height: 120px;
    border-radius: 24px;
}
[data-name="login"] .page-content .login-logo .logo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    background: linear-gradient(135deg, #FF8C00, #FFB347);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    font-weight: 700;
}

/* Tabs auf der Login-Seite */
[data-name="login"] .page-content .toolbar.tabbar {
    position: static;
}
[data-name="login"] .page-content .tab-link-highlight {
    bottom: 0;
    top: auto;
}
[data-name="login"] .page-content .tabs-animated-wrap {
    height: auto;
    flex-shrink: 0;
}
[data-name="login"] .page-content .tabs-animated-wrap .list {
    margin-top: 20px;
    margin-bottom: 0;
}
[data-name="login"] .page-content .tabs-animated-wrap .tab > .block {
    margin-top: 16px;
    margin-bottom: 8px;
}

[data-name="login"] .page-content .login-links {
    text-align: center;
    padding: 16px;
}
[data-name="login"] .page-content .login-links a {
    color: var(--ze-primary);
    text-decoration: none;
}

/* Zitat-Cards */
.quote-card {
    margin: 8px 16px;
    border-radius: 12px;
    background: var(--ze-card-bg);
    overflow: hidden;
}
.quote-card .card-content {
    padding: 16px;
}
.quote-card .quote-person {
    font-weight: 600;
    color: var(--ze-primary);
    font-size: 14px;
    margin-bottom: 4px;
}
.quote-card .quote-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 8px;
    color: var(--ze-text);
}
.quote-card .quote-text::before {
    content: '\201E';
    color: var(--ze-primary);
    font-size: 20px;
    font-weight: 700;
}
.quote-card .quote-text::after {
    content: '\201C';
    color: var(--ze-primary);
    font-size: 20px;
    font-weight: 700;
}
.quote-card .quote-meta {
    font-size: 12px;
    color: var(--ze-text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.quote-card .quote-info {
    font-size: 13px;
    color: var(--ze-text-secondary);
    font-style: italic;
    margin-top: 8px;
    padding: 8px;
    background: var(--ze-bg);
    border-radius: 8px;
}

/* Voting (Jodel-Style) */
.vote-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 44px;
}
.vote-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 20px;
    cursor: pointer;
    color: var(--ze-text-secondary);
    line-height: 1;
}
.vote-btn.active-up {
    color: var(--ze-upvote);
}
.vote-btn.active-down {
    color: var(--ze-downvote);
}
.vote-score {
    font-weight: 700;
    font-size: 16px;
    color: var(--ze-text);
    min-width: 30px;
    text-align: center;
}

/* Quote Footer */
.quote-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--ze-border);
}
.quote-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.quote-actions .action-btn {
    background: none;
    border: none;
    padding: 4px;
    font-size: 18px;
    cursor: pointer;
    color: var(--ze-text-secondary);
}
.quote-actions .action-btn.bookmarked {
    color: var(--ze-primary);
}

/* Dialog Chat Bubbles */
.dialog-lines {
    padding: 12px 16px;
}
.dialog-line {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    max-width: 85%;
}
.dialog-line.left {
    align-items: flex-start;
    align-self: flex-start;
}
.dialog-line.right {
    align-items: flex-end;
    align-self: flex-end;
    margin-left: auto;
}
.dialog-line .person-label {
    font-size: 11px;
    color: var(--ze-text-secondary);
    margin-bottom: 2px;
    padding: 0 8px;
}
.dialog-line .bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
}
.dialog-line.left .bubble {
    background: var(--ze-bg);
    color: var(--ze-text);
    border-bottom-left-radius: 4px;
}
.dialog-line.right .bubble {
    background: var(--ze-primary);
    color: white;
    border-bottom-right-radius: 4px;
}
.theme-dark .dialog-line.left .bubble {
    background: #3a3a3c;
}

/* Dialog Card Kontext */
.dialog-card .dialog-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--ze-text-secondary);
    padding: 12px 16px 4px;
}

/* (Dialog Card Titel) */

/* Statistik-Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 16px;
    margin: 16px 0;
}
.stat-card {
    background: var(--ze-card-bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--ze-primary);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 12px;
    color: var(--ze-text-secondary);
    margin-top: 4px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 32px;
}
.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state .empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ze-text);
    margin-bottom: 8px;
}
.empty-state .empty-text {
    font-size: 14px;
    color: var(--ze-text-secondary);
    margin-bottom: 24px;
}

/* Random Quote Card */
.random-quote-card {
    margin: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #FF8C00, #FFB347);
    color: white;
    overflow: hidden;
}
.random-quote-card .card-content {
    padding: 24px;
}
.random-quote-card .rq-person {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 8px;
}
.random-quote-card .rq-text {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 12px;
}
.random-quote-card .rq-date {
    font-size: 12px;
    opacity: 0.7;
}
.random-quote-card .card-footer {
    padding: 12px 24px;
    background: rgba(0,0,0,0.1);
}

/* Side Panel */
.panel .group-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.panel .group-list-item .group-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
}
.panel .group-list-item.active-group .group-indicator {
    background: var(--ze-primary);
}

/* Person Avatar */
.person-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ze-text-secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
img.person-avatar-img {
    object-fit: cover;
    background: none;
}

/* Person Cards */
.person-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}
.person-card .person-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ze-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}
.person-card .person-info {
    flex: 1;
}
.person-card .person-name {
    font-weight: 600;
    font-size: 16px;
}
.person-card .person-stats {
    font-size: 13px;
    color: var(--ze-text-secondary);
}

/* Badge */
.settings-badge {
    background: var(--ze-danger);
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}


/* Personen-Zuordnung Dialog – scrollbar bei langer Liste */
.person-link-dialog .dialog-inner {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--ze-text-secondary);
    border-radius: 2px;
}

/* Loading Overlay */
.custom-loading {
    text-align: center;
    padding: 24px;
    color: var(--ze-text-secondary);
}

/* Swipe Actions */
.swipeout-actions-right .swipeout-delete {
    background: var(--ze-danger);
}
