/* Ride chat overlay — passenger + driver */
.ride-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    font-family: inherit;
}

.ride-chat-panel {
    width: 100%;
    max-width: 430px;
    max-height: 88vh;
    background: var(--bg, #0f172a);
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ride-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ride-chat-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text, #f1f5f9);
}

.ride-chat-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, #f1f5f9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ride-chat-messages {
    flex: 1;
    min-height: 200px;
    max-height: 48vh;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ride-chat-row {
    display: flex;
    width: 100%;
}

.ride-chat-row.mine {
    justify-content: flex-start;
}

.ride-chat-row.theirs {
    justify-content: flex-end;
}

.ride-chat-bubble {
    max-width: 82%;
    padding: 10px 12px 8px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}

.ride-chat-row.mine .ride-chat-bubble {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(129, 140, 248, 0.25));
    border: 1px solid rgba(129, 140, 248, 0.35);
    color: var(--text, #f1f5f9);
}

.ride-chat-row.theirs .ride-chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text, #f1f5f9);
}

.ride-chat-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.85;
}

.ride-chat-ticks {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    letter-spacing: -2px;
    font-size: 13px;
    line-height: 1;
}

.ride-chat-ticks.sent {
    color: rgba(255, 255, 255, 0.45);
}

.ride-chat-ticks.delivered {
    color: rgba(255, 255, 255, 0.55);
}

.ride-chat-ticks.read {
    color: #53bdeb;
}

.ride-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ride-chat-input-row input {
    flex: 1;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text, #f1f5f9);
    font-family: inherit;
    font-size: 15px;
}

.ride-chat-input-row input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.ride-chat-send {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 14px;
    background: var(--primary, #6366f1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ride-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ride-chat-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    padding: 24px 12px;
}
