:root {
    --wa-green: #f28b7a;
    --wa-light-green: #fce8e6;
    --wa-bg: #442a59;
    --wa-header: #2d2050;
    --wa-gray: rgba(240, 240, 240, 0.95);
    --msg-recv: rgba(255, 255, 255, 0.9);
    
    /* Framework7 Theme Color Overrides */
    --f7-theme-color: var(--wa-green);
    --f7-theme-color-rgb: 242, 139, 122;
    --f7-theme-color-shade: #f06a55;
    --f7-theme-color-tint: #f5ac9f;
}

body {
    background-color: var(--wa-bg);
}

.hidden {
    display: none !important;
}

/* --- Pairing Screen --- */
#pairing-screen {
    justify-content: flex-end;
    align-items: center;
    background-color: var(--wa-header);
    background-image: url('back.jpeg');
    background-size: cover;
    background-position: center;
    padding: 20px;
    text-align: center;
    color: white;
}

.pairing-content {
    background: rgba(45, 32, 80, 0.6);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 15px;
    width: 100%;
    max-width: 350px;
    margin-bottom: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.logo {
    display: none;
}

#qrcode {
    margin: 10px auto;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    display: inline-block;
}

#qrcode img, #qrcode canvas {
    margin: 0 auto;
}

/* --- Framework7 Overrides --- */
.messagebar {
    background: var(--wa-header) !important;
}
.navbar, .navbar-bg, .subnavbar {
    background: rgba(45, 32, 80, 0.4) !important;
    background-color: rgba(45, 32, 80, 0.4) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-bottom: none !important;
    color: white !important;
}
.navbar-bg::after, .navbar::after, .subnavbar::after {
    display: none !important; /* Hide default thick F7 border lines */
}
.navbar-inner, .navbar .title {
    color: white !important;
}
#send-btn {
    min-width: 32px !important;
    width: 32px !important;
    margin-left: 8px !important;
}
#answer-input {
    width: 100%;
}
.message-system-bubble {
    background-color: var(--wa-header) !important;
    color: white !important;
    font-weight: bold;
}

/* Erzwinge transparente Chat-Ebenen, damit das Seiten_Hintergrundbild (back.jpeg) immer durchscheint */
.page-content, .messages-content, .messages, .chat-container {
    background: transparent !important;
    background-color: transparent !important;
}

/* Messages */
.message-system {
    align-self: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    animation: fadeInBubble 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

.sticky-wrapper {
    position: sticky;
    top: 75px; 
    z-index: 5;
    /* Optional: drop shadow to indicate floating? Handled effectively by backdrop-filter and borders on the message itself. */
}

@keyframes fadeInBubble {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Styling für empfangene und gesendete Nachrichten (ähnlich wie Question Card) */
.message-sent {
    margin-bottom: 30px !important; /* Deutlicherer Abstand zur Partnerantwort */
}

.message-sent .message-bubble {
    background: linear-gradient(135deg, rgba(93, 163, 235, 0.95), rgba(53, 116, 204, 0.95)) !important;
    color: white !important;
    border-radius: 18px 18px 0px 18px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
}

.message-received .message-bubble {
    background: linear-gradient(135deg, rgba(70, 175, 140, 0.95), rgba(30, 125, 95, 0.95)) !important;
    color: white !important;
    border-radius: 18px 18px 18px 0px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
}

/* Anpassung der Typographie in den Bubbles */
.message-sent .message-text {
    color: white !important;
    font-size: 1.05rem !important;
    line-height: 1.4 !important;
}

.message-received .message-text {
    color: white !important;
    font-size: 1.25rem !important;
    line-height: 1.45 !important;
}

.message.question-card, .message-bubble.question-card {
    background: linear-gradient(135deg, rgba(242, 139, 122, 0.95), rgba(68, 42, 89, 0.95)) !important;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin: 20px auto;
    padding: 20px 25px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    width: 90%;
    line-height: 1.4;
}

/* Styling für Fragenauswahl-Buttons */
.question-choice-btn {
    background-color: var(--wa-gray) !important;
    color: #333 !important;
    text-transform: none !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    padding: 16px 20px !important;
    margin-bottom: 12px !important;
    height: auto !important;
    white-space: normal !important;
    text-align: center !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}

.question-action-btn {
    background-color: var(--wa-header) !important;
    color: white !important;
    text-transform: none !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    padding: 16px 20px !important;
    margin-bottom: 12px !important;
    height: auto !important;
    white-space: normal !important;
    text-align: center !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

.question-card-wrapper {
    position: sticky;
    top: 10px;
    z-index: 100;
}

.custom-f7-toast {
    background-color: var(--wa-header) !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
    padding: 10px 20px !important;
}

/* Rating & Health Action Bar */
.action-bar {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 6px 15px;
    margin-top: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    gap: 12px;
}

.action-divider {
    width: 2px;
    height: 24px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.hearts-widget {
    font-size: 1.3rem; 
    cursor: pointer;
    display: flex;
    align-items: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rating-widget {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.5); /* inactive stars */
    cursor: pointer;
    display: flex;
    gap: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rating-widget .star {
    transition: color 0.2s, transform 0.2s;
}

.rating-widget .star:hover {
    transform: scale(1.15);
}

.rating-widget.sent-rating {
    margin-left: auto;
}

.received-rating {
    font-size: 1.3rem;
    color: #f1c40f;
    margin-top: 5px;
    margin-left: auto;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    body {
        align-items: center;
        background-color: #1c1543;
    }
    #app {
        max-width: 450px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0,0,0,0.5);
        position: relative;
    }
}

/* Typing Indicator Animation */
.typing-dot {
    width: 6px;
    height: 6px;
    background-color: rgba(255,255,255,0.7);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Safe Area for Next Round Button */
#next-round-area {
    margin-bottom: env(safe-area-inset-bottom, 15px) !important;
}

/* --- Joker Buttons --- */
.joker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    color: rgba(255,255,255,0.9);
    font-size: 15px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    user-select: none;
}
.joker-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}
.joker-btn:not(.disabled):active {
    background: rgba(255,255,255,0.35);
    transform: scale(0.9);
}
.joker-btn .cooldown-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: #ff2a5f;
    color: white;
    font-size: 9px;
    font-weight: bold;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
