* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f8f9fa; 
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#app-container {
    background: #ffffff; 
    width: 100%;
    max-width: 450px;
    height: 100vh;
    max-height: 850px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

@media (min-width: 480px) {
    #app-container {
        height: 90vh;
        border-radius: 30px; 
        border: 6px solid #f0f2f5;
    }
}

.app-section {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px; 
}

#auth-section, #register-section {
    justify-content: center;
    padding-bottom: 20px; 
}

h2, h3 {
    color: #1c1e21;
    margin-top: 0;
    margin-bottom: 20px;
}

input, select, button, textarea {
    margin-bottom: 15px;
    padding: 14px;
    border: 1px solid #e4e6eb;
    background-color: #f0f2f5; 
    border-radius: 16px; 
    font-size: 16px;
    width: 100%;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #ff6b35; 
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

button {
    background-color: #ff6b35; 
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    border-radius: 16px;
}

button:hover { opacity: 0.9; }
button:active { transform: scale(0.97); }

.btn-secondary { background-color: #e4e6eb; color: #050505; }
.btn-danger { background-color: #fa383e; color: white; }
.btn-warning { background-color: #ffc107; color: #212529; }
.btn-success { background-color: #42b72a; color: white; }

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #0084ff;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 20px;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.img-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    display: none;
    background-color: #f0f2f5;
}

.list-container {
    flex-grow: 1;
}

.modern-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.card {
    background: #ffffff;
    border: 1px solid #f0f2f5;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.modern-grid .card {
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modern-grid .card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
    margin-bottom: 8px;
    order: -1; 
}

.modern-grid .card-header {
    padding: 0 12px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.modern-grid .card-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-grid .card-body {
    padding: 0 12px 12px 12px;
    font-size: 13px;
    color: #65676B;
    margin-bottom: 0;
}

.modern-grid .card-footer {
    display: none; 
}

.search-container {
    display: flex;
    align-items: center;
    background: #f0f2f5;
    border-radius: 16px;
    padding: 6px 16px;
    margin-bottom: 25px;
}

.category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 20px;
    scrollbar-width: none; 
    -webkit-overflow-scrolling: touch; 
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 15px 10px;
    min-width: 85px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #1c1e21;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0; 
}

.cat-card.active {
    background: #fff;
    border-color: #e4e6eb;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.cat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.info-banner {
    background: #fff0eb; 
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.badge {
    background-color: #e4e6eb;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #050505;
    font-weight: 500;
}

#chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 20px;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-bubble.me {
    align-self: flex-end;
    background-color: #ff6b35;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.other {
    align-self: flex-start;
    background-color: #f0f2f5;
    color: black;
    border-bottom-left-radius: 4px;
}

#chat-input-area {
    display: flex;
    gap: 10px;
    background: white;
    padding-top: 10px;
}

#chat-input-area input { margin-bottom: 0; border-radius: 20px; background: #f0f2f5; }
#chat-input-area button { margin-bottom: 0; width: 80px; border-radius: 20px; background: #ff6b35; }

#bottom-nav {
    display: none; 
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid #f0f2f5;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0 15px 0;
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    color: #8a8d91;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    width: 20%;
    margin-bottom: 0;
}

.nav-item.active {
    color: #1c1e21; 
}

.nav-item.active .nav-icon {
    color: #ff6b35; 
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: color 0.2s;
}

/* NEU: Benachrichtigungskreis für Chat */
.nav-badge {
    position: absolute;
    top: 2px;
    right: 15px;
    background-color: #fa383e;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-fab-container {
    width: 20%;
    display: flex;
    justify-content: center;
    position: relative;
}

.nav-fab {
    position: absolute;
    bottom: -10px; 
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ff6b35; 
    color: white;
    font-size: 32px;
    font-weight: 300;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
    border: none;
    cursor: pointer;
    z-index: 110;
    padding: 0;
    margin: 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
}
.top-bar h3 { margin: 0; font-size: 22px;}
.top-bar button { width: auto; margin: 0; padding: 8px 14px; font-size: 14px; }

.star-rating {
    font-size: 24px;
    color: #ffc107;
    cursor: pointer;
    transition: transform 0.1s;
    display: inline-block;
    margin-right: 2px;
}
.star-rating:hover {
    transform: scale(1.2);
}

body:has(#auth-section[style*="display: flex"]) #bottom-nav,
body:has(#register-section[style*="display: flex"]) #bottom-nav {
    display: none !important;
}