/* ============================================================
   handwerker-platform.css
   Spezifische Styles für die Handwerker-Plattform
   ============================================================ */

/* ---- Filter-Bar ---- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg, #fff);
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.filter-bar label {
    font-weight: 500;
    margin-bottom: 0;
}

.filter-bar input[type="range"] {
    flex: 1;
    min-width: 120px;
}

.filter-bar select,
.filter-bar .filter-select {
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color, #dee2e6);
    background: var(--input-bg, #fff);
    color: var(--text-color, #212529);
}

/* ---- Chat / Nachrichten ---- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 60vh;
    min-height: 320px;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--card-bg, #fff);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-bubble {
    max-width: 70%;
    padding: 0.5rem 0.875rem;
    border-radius: 1rem;
    font-size: 0.925rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-bubble.own {
    align-self: flex-end;
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble.other {
    align-self: flex-start;
    background: var(--secondary-bg, #f1f3f5);
    color: var(--text-color, #212529);
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble .bubble-meta {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.2rem;
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color, #dee2e6);
    background: var(--card-bg, #fff);
}

.chat-input-row textarea {
    flex: 1;
    resize: none;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color, #dee2e6);
    padding: 0.4rem 0.75rem;
    font-size: 0.925rem;
    background: var(--input-bg, #fff);
    color: var(--text-color, #212529);
}

/* ---- Konversationsliste ---- */
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.conversation-item:hover {
    background: var(--secondary-bg, #f8f9fa);
}

.conversation-item.unread {
    border-left: 3px solid #0d6efd;
}

.conversation-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 0.85rem;
    color: var(--muted-color, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 0.25rem;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--muted-color, #6c757d);
}

/* ---- Unread-Badge ---- */
.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc3545;
    color: #fff;
    border-radius: 999px;
    min-width: 1.25rem;
    height: 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 0.35rem;
}

/* ---- Status-Badges (Interesse) ---- */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.interested {
    background: #fff3cd;
    color: #856404;
}

.status-badge.accepted {
    background: #d1e7dd;
    color: #0a3622;
}

.status-badge.rejected {
    background: #f8d7da;
    color: #58151c;
}

.status-badge.completed {
    background: #cfe2ff;
    color: #084298;
}

/* ---- Projekt-Status-Badges ---- */
.project-status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-status-badge.open {
    background: #d1e7dd;
    color: #0a3622;
}

.project-status-badge.inprogress {
    background: #fff3cd;
    color: #856404;
}

.project-status-badge.completed {
    background: #cfe2ff;
    color: #084298;
}

.project-status-badge.cancelled {
    background: #e2e3e5;
    color: #41464b;
}

/* ---- Interesse-Button ---- */
.interest-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.15s;
}

.interest-btn.already-interested {
    background: #d1e7dd;
    color: #0a3622;
    border-color: #a3cfbb;
    cursor: default;
}

/* ---- Organisations-Karte ---- */
.org-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.org-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.org-card .org-meta {
    font-size: 0.85rem;
    color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.org-card .category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* ---- Projekt-Karte ---- */
.project-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.project-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.project-card .project-meta {
    font-size: 0.85rem;
    color: var(--muted-color, #6c757d);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---- Distanz-Badge ---- */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--secondary-bg, #f1f3f5);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color, #212529);
}

/* ---- Interests-Tabelle ---- */
.interests-table {
    width: 100%;
    border-collapse: collapse;
}

.interests-table th,
.interests-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    font-size: 0.9rem;
}

.interests-table th {
    font-weight: 600;
    background: var(--secondary-bg, #f8f9fa);
}

/* ---- Dialog / Modal Overlay ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-box {
    background: var(--card-bg, #fff);
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.modal-box h4 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ---- Verified Badge ---- */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #d1e7dd;
    color: #0a3622;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.unverified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f8d7da;
    color: #58151c;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ---- Responsiv ---- */
@media (max-width: 600px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .chat-bubble {
        max-width: 90%;
    }
    .modal-box {
        padding: 1rem;
    }
}
