/**
 * Driver Connect - Live GPS Sharing & Driver Markers
 */

/* Driver marker container */
.driver-marker-container {
    background: transparent;
    border: none;
    transition: transform 0.3s ease;
}

.driver-marker {
    transition: transform 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.driver-marker:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

/* Driver popup styles */
.driver-popup {
    min-width: 200px;
}

.driver-popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
    color: #1a73e8;
}

.driver-popup-header i {
    font-size: 18px;
}

.driver-popup-header strong {
    font-size: 14px;
}

.driver-popup-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.driver-popup-body > div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}

.driver-popup-body i {
    width: 16px;
    color: #1a73e8;
    font-size: 12px;
}

/* Driver popup actions */
.driver-popup-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.driver-action-btn {
    flex: 1;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.driver-action-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.driver-action-btn i {
    font-size: 11px;
}

.driver-message-btn {
    color: #1a73e8;
}

.driver-message-btn:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
}

.driver-block-btn {
    color: #d32f2f;
}

.driver-block-btn:hover {
    background: #ffebee;
    border-color: #d32f2f;
}

/* GPS sharing toggle in drawer */
#gps-sharing-toggle {
    cursor: pointer;
}

#gps-sharing-checkbox {
    width: 42px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2px;
}

#gps-sharing-checkbox::before {
    content: '';
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    left: 2px;
    transition: transform 0.2s;
}

#gps-sharing-checkbox.active {
    background: #1a73e8;
    justify-content: flex-end;
}

#gps-sharing-checkbox.active::before {
    transform: translateX(18px);
}

#gps-sharing-checkbox i {
    font-size: 10px;
    color: white;
    margin-left: auto;
    margin-right: 4px;
    z-index: 1;
}

.nav-drawer-item-hint {
    padding: 8px 16px 8px 48px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 8px;
    margin: 0 12px 8px 12px;
}

.nav-drawer-item-hint i {
    color: #1a73e8;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Dark theme */
[data-theme="dark"] .driver-popup-header {
    border-bottom-color: #333;
}

[data-theme="dark"] .driver-popup-body > div {
    color: #ccc;
}

[data-theme="dark"] .nav-drawer-item-hint {
    background: #2d2d2d;
    color: #aaa;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .driver-marker {
        transform: scale(0.9);
    }

    .driver-popup {
        min-width: 150px;
    }

    .driver-popup-header strong {
        font-size: 13px;
    }

    .driver-popup-body > div {
        font-size: 12px;
    }
}

/* Animation for new driver markers */
@keyframes driverJoin {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.driver-marker-container.new {
    animation: driverJoin 0.4s ease;
}

/* Pulse animation for active drivers */
@keyframes driverPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.driver-marker-container.active {
    animation: driverPulse 2s infinite;
}

/* Loading state for GPS toggle */
#gps-sharing-toggle.loading {
    opacity: 0.6;
    pointer-events: none;
}

#gps-sharing-toggle.loading #gps-sharing-checkbox {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════
   Driver Connect Panel (dcp-*)
   Mobile: Bottom sheet  |  Desktop: Right sidebar
   ═══════════════════════════════════════════════════ */

/* DC Button & Badge (on map controls) */
#nav-dc-btn {
    position: relative;
}

.nav-dc-icon {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

[data-theme="dark"] .nav-dc-icon {
    filter: brightness(0) invert(1);
}

.nav-dc-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: none;
    animation: dcBadgePulse 2s infinite;
}

/* Absolute positioning inside map-btn (desktop/fallback) */
.nav-map-btn .nav-dc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
}

.nav-dc-badge.has-messages {
    display: block;
}

@keyframes dcBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ─── Panel Base ───────────────────────────────── */
.dcp-panel {
    display: flex;
    flex-direction: column;
    background: white;
    z-index: 1006;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s 0.3s;
    pointer-events: none;
    visibility: hidden;
}

.dcp-panel.dcp-open {
    pointer-events: auto;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s 0s;
}

/* Mobile: Bottom sheet */
.dcp-panel--mobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
}

.dcp-panel--mobile.dcp-open {
    transform: translateY(0);
}

/* Desktop: Right sidebar */
.dcp-panel--desktop {
    position: fixed;
    top: 80px;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: calc(100vh - 80px);
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
}

.dcp-panel--desktop.dcp-open {
    transform: translateX(0);
}

/* ─── Header ───────────────────────────────────── */
.dcp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.dcp-header-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dcp-header-title i {
    color: #1a73e8;
}

.dcp-header-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.dcp-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dcp-invite-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #1a73e8;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.dcp-invite-btn:hover {
    background: #e8f0fe;
}

.dcp-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.dcp-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* ─── Tabs ─────────────────────────────────────── */
.dcp-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    padding: 0 12px;
}

.dcp-tab {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.dcp-tab:hover {
    color: #1a73e8;
    background: #f8f9fa;
}

.dcp-tab.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

.dcp-tab i {
    font-size: 12px;
}

.dcp-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

/* ─── Content Area ─────────────────────────────── */
.dcp-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.dcp-view {
    display: none;
    padding: 12px 16px;
}

.dcp-view.active {
    display: block;
}

/* ─── Status Bar ───────────────────────────────── */
.dcp-status {
    padding: 8px 16px;
    font-size: 11px;
    color: #999;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Loading & Empty States ───────────────────── */
.dcp-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 24px;
}

.dcp-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #999;
}

.dcp-empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
    display: block;
}

.dcp-empty-state p {
    font-size: 15px;
    margin: 8px 0 4px;
    color: #666;
}

.dcp-empty-state small {
    font-size: 12px;
    color: #999;
}

/* ─── Section Headers ──────────────────────────── */
.dcp-section-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    padding: 12px 0 6px;
}

/* ─── Avatar ───────────────────────────────────── */
.dcp-avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

/* ─── Driver List (Nearby Tab) ─────────────────── */
.dcp-driver-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dcp-driver-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.dcp-driver-item:hover {
    background: #f5f7fa;
}

.dcp-driver-info {
    flex: 1;
    min-width: 0;
}

.dcp-driver-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcp-driver-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.dcp-driver-meta i {
    font-size: 10px;
    margin-right: 3px;
}

.dcp-driver-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.dcp-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 13px;
}

.dcp-action-btn:hover {
    background: #e0e0e0;
}

.dcp-action-msg { color: #1a73e8; }
.dcp-action-msg:hover { background: #e8f0fe; }
.dcp-action-invite { color: #4caf50; }
.dcp-action-invite:hover { background: #e8f5e9; }
.dcp-action-accept { color: #4caf50; }
.dcp-action-accept:hover { background: #e8f5e9; }
.dcp-action-reject { color: #f44336; }
.dcp-action-reject:hover { background: #ffebee; }
.dcp-action-delete { color: #f44336; }
.dcp-action-delete:hover { background: #ffebee; }
.dcp-action-sent { color: #999; cursor: default; opacity: 0.6; }
.dcp-action-sent:hover { background: #f0f0f0; }

/* ─── Conversation List ────────────────────────── */
.dcp-conversation-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dcp-conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.dcp-conversation-item:hover {
    background: #f5f7fa;
}

.dcp-conversation-item.dcp-unread {
    background: #e8f0fe;
}

.dcp-conversation-info {
    flex: 1;
    min-width: 0;
}

.dcp-conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.dcp-conversation-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcp-conversation-time {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
    margin-left: 8px;
}

.dcp-conversation-preview {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dcp-unread-badge {
    background: #1a73e8;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ─── Contact List ─────────────────────────────── */
.dcp-contact-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dcp-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.15s;
}

.dcp-contact-item:hover {
    background: #f5f7fa;
}

.dcp-contact-item.dcp-blocked {
    opacity: 0.6;
}

.dcp-contact-info {
    flex: 1;
    min-width: 0;
}

.dcp-contact-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.dcp-contact-status {
    font-size: 12px;
    color: #ff9800;
}

.dcp-contact-actions {
    display: flex;
    gap: 6px;
}

/* ─── Chat View ────────────────────────────────── */

/* Mobile chat overlay (full screen) */
.dcp-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1010;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s 0.3s;
    pointer-events: none;
    visibility: hidden;
}

.dcp-chat-overlay.dcp-chat-open {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s 0s;
}

/* Desktop: panel replaces content */
.dcp-panel.dcp-chat-mode .dcp-tabs,
.dcp-panel.dcp-chat-mode .dcp-content,
.dcp-panel.dcp-chat-mode .dcp-status {
    display: none;
}

.dcp-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dcp-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.dcp-chat-back {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.dcp-chat-back:hover {
    background: #f5f5f5;
    color: #333;
}

.dcp-chat-header-info {
    flex: 1;
    min-width: 0;
}

.dcp-chat-header-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.dcp-chat-header-actions {
    display: flex;
}

.dcp-chat-menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.dcp-chat-menu-btn:hover {
    background: #f5f5f5;
}

.dcp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dcp-chat-empty {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}

.dcp-chat-empty i {
    font-size: 40px;
    margin-bottom: 12px;
}

.dcp-chat-empty p {
    font-size: 14px;
    color: #999;
}

.dcp-message {
    display: flex;
    max-width: 80%;
}

.dcp-message--sent {
    align-self: flex-end;
}

.dcp-message--received {
    align-self: flex-start;
}

.dcp-message-bubble {
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.dcp-message--sent .dcp-message-bubble {
    background: #1a73e8;
    color: white;
    border-bottom-right-radius: 4px;
}

.dcp-message--received .dcp-message-bubble {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.dcp-message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
    text-align: right;
}

.dcp-message--received .dcp-message-time {
    text-align: left;
}

/* Chat input area */
.dcp-chat-input-container {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    background: white;
}

.dcp-chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.dcp-chat-input:focus {
    border-color: #1a73e8;
}

.dcp-chat-send {
    width: 40px;
    height: 40px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.dcp-chat-send:hover {
    background: #1557b0;
}

/* Chat context menu */
.dcp-chat-menu {
    position: absolute;
    top: 52px;
    right: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
    flex-direction: column;
    overflow: hidden;
}

.dcp-chat-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    width: 100%;
}

.dcp-chat-menu button:hover {
    background: #f5f5f5;
}

.dcp-chat-menu button i {
    width: 16px;
    text-align: center;
    color: #666;
}

/* ─── Invite Modal ─────────────────────────────── */
.dcp-invite-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dcp-invite-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.dcp-invite-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.dcp-invite-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.dcp-invite-close-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.dcp-invite-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.dcp-invite-body {
    padding: 16px 20px;
}

.dcp-invite-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 16px;
}

.dcp-invite-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 6px;
}

.dcp-invite-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.dcp-invite-select:focus {
    border-color: #1a73e8;
}

.dcp-invite-preview {
    margin-top: 12px;
    padding: 12px 16px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
    background: #fafafa;
}

.dcp-invite-footer {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.dcp-invite-share-btn {
    flex: 1;
    padding: 10px 16px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dcp-invite-share-btn:hover {
    background: #1557b0;
}

.dcp-invite-copy-btn {
    width: 42px;
    padding: 10px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcp-invite-copy-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* ─── Onboarding Overlay ──────────────────────── */
.dcp-onboarding {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dcp-onboarding-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dcp-onboarding-card {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    padding: 32px 24px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.dcp-onboarding-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.dcp-onboarding-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
}

.dcp-onboarding-subtitle {
    font-size: 14px;
    color: #888;
    margin: 0 0 24px;
    line-height: 1.4;
}

.dcp-onboarding-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 6px;
    text-align: left;
}

.dcp-onboarding-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.dcp-onboarding-input:focus {
    border-color: #1a73e8;
}

.dcp-vehicle-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.dcp-vehicle-btn {
    flex: 1;
    padding: 10px 8px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.dcp-vehicle-btn:hover {
    background: #e8f0fe;
    border-color: #c2d7f7;
}

.dcp-vehicle-btn.active {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

.dcp-vehicle-emoji {
    font-size: 16px;
}

.dcp-onboarding-join {
    width: 100%;
    padding: 14px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dcp-onboarding-join:hover {
    background: #1557b0;
}

.dcp-onboarding-skip {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 16px;
    transition: color 0.2s;
}

.dcp-onboarding-skip:hover {
    color: #333;
}

/* ─── Settings Button ──────────────────────────── */
.dcp-settings-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.dcp-settings-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* ─── Search Button ───────────────────────────────── */
.dcp-search-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.dcp-search-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* ─── Search Subview ──────────────────────────────── */
.dcp-panel.dcp-search-mode .dcp-tabs,
.dcp-panel.dcp-search-mode .dcp-content,
.dcp-panel.dcp-search-mode .dcp-status {
    display: none;
}

.dcp-search {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.dcp-search-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.dcp-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.dcp-search-icon {
    color: #999;
    font-size: 14px;
    flex-shrink: 0;
}

.dcp-search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}

.dcp-search-input:focus {
    border-color: #1a73e8;
}

.dcp-search-clear {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dcp-search-clear:hover {
    background: #e0e0e0;
    color: #333;
}

.dcp-search-results {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    overscroll-behavior: contain;
}

/* ─── Settings Subview ─────────────────────────── */
.dcp-panel.dcp-settings-mode .dcp-tabs,
.dcp-panel.dcp-settings-mode .dcp-content,
.dcp-panel.dcp-settings-mode .dcp-status {
    display: none;
}

.dcp-settings {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.dcp-settings-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.dcp-settings-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.dcp-settings-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    overscroll-behavior: contain;
}

.dcp-settings-section {
    margin-bottom: 24px;
}

.dcp-settings-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 12px;
}

.dcp-settings-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
    display: block;
}

.dcp-settings-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    margin-bottom: 14px;
}

.dcp-settings-input:focus {
    border-color: #1a73e8;
}

.dcp-settings-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.dcp-settings-id {
    font-family: monospace;
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 8px;
    flex: 1;
}

.dcp-settings-copy-id {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 13px;
    flex-shrink: 0;
}

.dcp-settings-copy-id:hover {
    background: #e0e0e0;
    color: #333;
}

.dcp-contact-mode-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dcp-mode-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.dcp-mode-option:hover {
    border-color: #ccc;
}

.dcp-mode-option.active {
    border-color: #1a73e8;
    background: #e8f0fe;
}

.dcp-mode-option input[type="radio"] {
    accent-color: #1a73e8;
    margin: 0;
    flex-shrink: 0;
}

.dcp-mode-info {
    display: flex;
    flex-direction: column;
}

.dcp-mode-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.dcp-mode-desc {
    font-size: 12px;
    color: #888;
    margin-top: 1px;
}

.dcp-settings-delete-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid #f44336;
    color: #f44336;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dcp-settings-delete-btn:hover {
    background: #ffebee;
}

/* ═══════════════════════════════════════════════════
   Dark Theme
   ═══════════════════════════════════════════════════ */
[data-theme="dark"] .dcp-panel {
    background: #1e1e1e;
}

[data-theme="dark"] .dcp-header {
    border-bottom-color: #333;
}

[data-theme="dark"] .dcp-header-title {
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-header-icon {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .dcp-invite-btn {
    color: #5b9cf6;
}

[data-theme="dark"] .dcp-invite-btn:hover {
    background: #1a2a3c;
}

[data-theme="dark"] .dcp-close-btn {
    color: #aaa;
}

[data-theme="dark"] .dcp-close-btn:hover {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-tabs {
    border-bottom-color: #333;
}

[data-theme="dark"] .dcp-tab {
    color: #aaa;
}

[data-theme="dark"] .dcp-tab:hover {
    background: #2a2a2a;
    color: #1a73e8;
}

[data-theme="dark"] .dcp-tab.active {
    color: #1a73e8;
}

[data-theme="dark"] .dcp-status {
    border-top-color: #333;
    color: #777;
}

[data-theme="dark"] .dcp-empty-state p {
    color: #aaa;
}

[data-theme="dark"] .dcp-section-header {
    color: #777;
}

[data-theme="dark"] .dcp-driver-item:hover,
[data-theme="dark"] .dcp-conversation-item:hover,
[data-theme="dark"] .dcp-contact-item:hover {
    background: #2a2a2a;
}

[data-theme="dark"] .dcp-driver-name,
[data-theme="dark"] .dcp-conversation-name,
[data-theme="dark"] .dcp-contact-name {
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-conversation-item.dcp-unread {
    background: #1a2a3c;
}

[data-theme="dark"] .dcp-action-btn {
    background: #333;
    color: #aaa;
}

[data-theme="dark"] .dcp-action-btn:hover {
    background: #444;
}

[data-theme="dark"] .dcp-action-msg { color: #1a73e8; }
[data-theme="dark"] .dcp-action-msg:hover { background: #1a2a3c; }

/* Dark chat */
[data-theme="dark"] .dcp-chat-overlay {
    background: #1e1e1e;
}

[data-theme="dark"] .dcp-chat-header {
    border-bottom-color: #333;
}

[data-theme="dark"] .dcp-chat-back,
[data-theme="dark"] .dcp-chat-menu-btn {
    color: #aaa;
}

[data-theme="dark"] .dcp-chat-back:hover,
[data-theme="dark"] .dcp-chat-menu-btn:hover {
    background: #333;
}

[data-theme="dark"] .dcp-chat-header-name {
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-message--received .dcp-message-bubble {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-chat-input-container {
    border-top-color: #333;
    background: #1e1e1e;
}

[data-theme="dark"] .dcp-chat-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-chat-menu {
    background: #2a2a2a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .dcp-chat-menu button {
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-chat-menu button:hover {
    background: #333;
}

/* Dark invite modal */
[data-theme="dark"] .dcp-invite-content {
    background: #1e1e1e;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .dcp-invite-header {
    border-bottom-color: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-invite-close-btn {
    color: #aaa;
}

[data-theme="dark"] .dcp-invite-close-btn:hover {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-invite-description {
    color: #aaa;
}

[data-theme="dark"] .dcp-invite-label {
    color: #777;
}

[data-theme="dark"] .dcp-invite-select {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .dcp-invite-preview {
    border-color: #444;
    background: #2a2a2a;
    color: #aaa;
}

[data-theme="dark"] .dcp-invite-footer {
    border-top-color: #333;
}

[data-theme="dark"] .dcp-invite-copy-btn {
    background: #333;
    color: #aaa;
}

[data-theme="dark"] .dcp-invite-copy-btn:hover {
    background: #444;
    color: #e0e0e0;
}

/* Dark onboarding */
[data-theme="dark"] .dcp-onboarding-card {
    background: #1e1e1e;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .dcp-onboarding-logo {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .dcp-onboarding-title {
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-onboarding-subtitle {
    color: #999;
}

[data-theme="dark"] .dcp-onboarding-label {
    color: #777;
}

[data-theme="dark"] .dcp-onboarding-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-onboarding-input:focus {
    border-color: #1a73e8;
}

[data-theme="dark"] .dcp-vehicle-btn {
    background: #2a2a2a;
    color: #aaa;
}

[data-theme="dark"] .dcp-vehicle-btn:hover {
    background: #1a2a3c;
    border-color: #2a4a6c;
}

[data-theme="dark"] .dcp-vehicle-btn.active {
    background: #1a2a3c;
    border-color: #1a73e8;
    color: #5b9cf6;
}

[data-theme="dark"] .dcp-onboarding-skip {
    color: #888;
}

[data-theme="dark"] .dcp-onboarding-skip:hover {
    color: #ccc;
}

/* Dark search */
[data-theme="dark"] .dcp-search-btn {
    color: #aaa;
}

[data-theme="dark"] .dcp-search-btn:hover {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-search-header {
    border-bottom-color: #333;
}

[data-theme="dark"] .dcp-search-input-wrap {
    border-bottom-color: #333;
}

[data-theme="dark"] .dcp-search-icon {
    color: #666;
}

[data-theme="dark"] .dcp-search-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-search-input:focus {
    border-color: #1a73e8;
}

[data-theme="dark"] .dcp-search-clear {
    background: #333;
    color: #aaa;
}

[data-theme="dark"] .dcp-search-clear:hover {
    background: #444;
    color: #e0e0e0;
}

/* Dark settings */
[data-theme="dark"] .dcp-settings-btn {
    color: #aaa;
}

[data-theme="dark"] .dcp-settings-btn:hover {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-settings-header {
    border-bottom-color: #333;
}

[data-theme="dark"] .dcp-settings-title {
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-settings-section-title {
    color: #777;
}

[data-theme="dark"] .dcp-settings-label {
    color: #aaa;
}

[data-theme="dark"] .dcp-settings-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-settings-input:focus {
    border-color: #1a73e8;
}

[data-theme="dark"] .dcp-settings-id {
    background: #2a2a2a;
    color: #aaa;
}

[data-theme="dark"] .dcp-settings-copy-id {
    background: #333;
    color: #aaa;
}

[data-theme="dark"] .dcp-settings-copy-id:hover {
    background: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-mode-option {
    border-color: #444;
}

[data-theme="dark"] .dcp-mode-option:hover {
    border-color: #555;
}

[data-theme="dark"] .dcp-mode-option.active {
    border-color: #1a73e8;
    background: #1a2a3c;
}

[data-theme="dark"] .dcp-mode-name {
    color: #e0e0e0;
}

[data-theme="dark"] .dcp-mode-desc {
    color: #777;
}

[data-theme="dark"] .dcp-settings-delete-btn {
    background: #1e1e1e;
    border-color: #f44336;
}

[data-theme="dark"] .dcp-settings-delete-btn:hover {
    background: #2a1515;
}

/* ═══════════════════════════════════════════════════
   Mobile Adjustments
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .dcp-panel--mobile {
        max-height: 85vh;
    }

    .dcp-tab {
        font-size: 12px;
        padding: 10px 6px;
    }

    .dcp-driver-item,
    .dcp-conversation-item,
    .dcp-contact-item {
        padding: 10px 8px;
    }
}

/* ─── Settings Toggle ─────────────────────────────── */
.dcp-settings-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

.dcp-settings-toggle input[type="checkbox"] {
    width: 40px;
    height: 22px;
    appearance: none;
    -webkit-appearance: none;
    background: #ccc;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.dcp-settings-toggle input[type="checkbox"]::before {
    content: '';
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.dcp-settings-toggle input[type="checkbox"]:checked {
    background: #1a73e8;
}

.dcp-settings-toggle input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

.dcp-settings-toggle span {
    font-size: 14px;
    color: #333;
}

[data-theme="dark"] .dcp-settings-toggle input[type="checkbox"] {
    background: #555;
}

[data-theme="dark"] .dcp-settings-toggle input[type="checkbox"]:checked {
    background: #1a73e8;
}

[data-theme="dark"] .dcp-settings-toggle span {
    color: #e0e0e0;
}

/* ═══════════════════════════════════════════════════
   Rich Messaging
   ═══════════════════════════════════════════════════ */

/* ─── Attachment Bar ──────────────────────────────── */
.dcp-attach-btn,
.dcp-voice-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dcp-attach-btn:hover { background: #e0e0e0; color: #1a73e8; }
.dcp-voice-btn:hover { background: #e0e0e0; color: #e91e63; }
.dcp-voice-btn.recording { background: #e91e63; color: white; }

/* ─── Voice Recording Indicator ───────────────────── */
.dcp-voice-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #fff5f5;
    border-top: 1px solid #fcc;
    flex-shrink: 0;
}

.dcp-voice-dot {
    width: 10px;
    height: 10px;
    background: #e91e63;
    border-radius: 50%;
    animation: dcVoicePulse 1s infinite;
}

@keyframes dcVoicePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.dcp-voice-label {
    font-size: 13px;
    color: #e91e63;
    font-weight: 500;
}

.dcp-voice-timer {
    font-size: 13px;
    font-family: monospace;
    color: #666;
    margin-left: auto;
}

.dcp-voice-stop {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #e91e63;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ─── Rich Message: Image ─────────────────────────── */
.dcp-msg-image {
    max-width: 240px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 4px;
}

.dcp-msg-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
}

/* ─── Rich Message: Voice ─────────────────────────── */
.dcp-msg-voice {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    padding: 4px 0;
}

.dcp-voice-play-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.dcp-message--received .dcp-voice-play-btn {
    background: rgba(0,0,0,0.08);
}

.dcp-voice-wave {
    flex: 1;
    height: 20px;
    background: linear-gradient(90deg, currentColor 2px, transparent 2px) 0 0 / 4px 100%;
    opacity: 0.3;
    border-radius: 2px;
}

.dcp-voice-duration {
    font-size: 11px;
    opacity: 0.7;
    flex-shrink: 0;
}

/* ─── Rich Message: POI Card ──────────────────────── */
.dcp-msg-poi {
    cursor: pointer;
    margin-bottom: 4px;
}

.dcp-poi-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    transition: background 0.15s;
}

.dcp-message--received .dcp-poi-card {
    background: rgba(0,0,0,0.05);
}

.dcp-poi-card:hover {
    background: rgba(255,255,255,0.25);
}

.dcp-poi-icon {
    font-size: 18px;
    opacity: 0.8;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.dcp-poi-info {
    flex: 1;
    min-width: 0;
}

.dcp-poi-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcp-poi-type {
    font-size: 11px;
    opacity: 0.7;
}

.dcp-poi-arrow {
    font-size: 10px;
    opacity: 0.5;
    flex-shrink: 0;
}

/* ─── Rich Message: Location Card ─────────────────── */
.dcp-msg-location {
    cursor: pointer;
    margin-bottom: 4px;
}

.dcp-location-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
}

.dcp-message--received .dcp-location-card {
    background: rgba(0,0,0,0.05);
}

.dcp-location-icon {
    font-size: 18px;
    color: #e91e63;
    flex-shrink: 0;
}

.dcp-location-coords {
    font-family: monospace;
    font-size: 12px;
    opacity: 0.9;
}

/* ─── Auto-link Styles ────────────────────────────── */
.dcp-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

.dcp-message--sent .dcp-link { color: rgba(255,255,255,0.9); }
.dcp-message--received .dcp-link { color: #1a73e8; }

.dcp-coord-link {
    color: inherit;
    text-decoration: none;
    background: rgba(255,255,255,0.15);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.dcp-message--received .dcp-coord-link {
    background: rgba(0,0,0,0.06);
    color: #1a73e8;
}

/* ─── Image Viewer (Lightbox) ─────────────────────── */
.dcp-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcp-image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dcp-image-viewer-img {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}

.dcp-image-viewer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1;
}

.dcp-image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ─── POI Share via DC Button ─────────────────────── */
.poi-action-share-dc {
    color: #1a73e8 !important;
}

.poi-action-share-dc:hover {
    background: #e8f0fe !important;
}

/* ═══════════════════════════════════════════════════
   Rich Messaging - Dark Theme
   ═══════════════════════════════════════════════════ */
[data-theme="dark"] .dcp-attach-btn,
[data-theme="dark"] .dcp-voice-btn {
    background: #333;
    color: #aaa;
}

[data-theme="dark"] .dcp-attach-btn:hover { background: #444; color: #5b9cf6; }
[data-theme="dark"] .dcp-voice-btn:hover { background: #444; color: #e91e63; }

[data-theme="dark"] .dcp-voice-indicator {
    background: #2a1515;
    border-top-color: #4a2020;
}

[data-theme="dark"] .dcp-voice-timer {
    color: #aaa;
}

[data-theme="dark"] .dcp-message--received .dcp-poi-card,
[data-theme="dark"] .dcp-message--received .dcp-location-card {
    background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .dcp-message--received .dcp-link {
    color: #5b9cf6;
}

[data-theme="dark"] .dcp-message--received .dcp-coord-link {
    background: rgba(255,255,255,0.08);
    color: #5b9cf6;
}

[data-theme="dark"] .dcp-message--received .dcp-voice-play-btn {
    background: rgba(255,255,255,0.1);
}

/* ─── Auto-Reply Messages ─────────────────────────── */

.dcp-message--auto-reply .dcp-message-bubble {
    opacity: 0.7;
}

.dcp-message--auto-reply .dcp-message-text {
    font-style: italic;
    color: #8e8e93;
}

[data-theme="dark"] .dcp-message--auto-reply .dcp-message-text {
    color: #636366;
}

/* ─── Voice Expiry Settings ───────────────────────── */

.dcp-voice-expiry-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.dcp-expiry-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #d1d1d6;
    background: #fff;
    font-size: 13px;
    transition: all 0.2s;
}

.dcp-expiry-option input[type="radio"] {
    display: none;
}

.dcp-expiry-option.active {
    background: #007AFF;
    color: #fff;
    border-color: #007AFF;
}

[data-theme="dark"] .dcp-expiry-option {
    border-color: #3a3a3c;
    background: #2c2c2e;
    color: #e5e5ea;
}

[data-theme="dark"] .dcp-expiry-option.active {
    background: #0A84FF;
    border-color: #0A84FF;
    color: #fff;
}

/* ─── Message Selection & Action Sheet ───────────── */

.dcp-message--selected .dcp-message-bubble {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
    opacity: 0.85;
}

.dcp-msg-action-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.dcp-msg-action-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease;
}

.dcp-msg-action-sheet--open .dcp-msg-action-backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.dcp-msg-action-menu {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 14px 14px 0 0;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

.dcp-msg-action-sheet--open .dcp-msg-action-menu {
    transform: translateY(0);
}

.dcp-msg-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.dcp-msg-action-btn:active {
    background: #f2f2f7;
}

.dcp-msg-action-btn i {
    width: 20px;
    text-align: center;
    color: #8e8e93;
}

.dcp-msg-action-btn--danger {
    color: #ff3b30;
}

.dcp-msg-action-btn--danger i {
    color: #ff3b30;
}

.dcp-msg-action-btn--cancel {
    margin-top: 4px;
    border-top: 1px solid #e5e5ea;
    justify-content: center;
    font-weight: 600;
    color: #007AFF;
}

[data-theme="dark"] .dcp-msg-action-menu {
    background: #2c2c2e;
}

[data-theme="dark"] .dcp-msg-action-btn {
    color: #e5e5ea;
}

[data-theme="dark"] .dcp-msg-action-btn:active {
    background: #3a3a3c;
}

[data-theme="dark"] .dcp-msg-action-btn i {
    color: #8e8e93;
}

[data-theme="dark"] .dcp-msg-action-btn--danger {
    color: #ff453a;
}

[data-theme="dark"] .dcp-msg-action-btn--danger i {
    color: #ff453a;
}

[data-theme="dark"] .dcp-msg-action-btn--cancel {
    border-top-color: #3a3a3c;
    color: #0A84FF;
}

[data-theme="dark"] .dcp-message--selected .dcp-message-bubble {
    outline-color: #0A84FF;
}

/* ─── Mobile Adjustments for Rich ─────────────────── */
@media (max-width: 768px) {
    .dcp-msg-image {
        max-width: 200px;
    }

    .dcp-attach-btn,
    .dcp-voice-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* SVG icon support (replaces FontAwesome) */
.dcp-panel .v2-icon,
.dcp-chat .v2-icon,
.driver-popup .v2-icon {
    display: inline-block;
    vertical-align: -0.125em;
    width: 1em;
    height: 1em;
}

.v2-icon-spin {
    animation: v2-spin 1s linear infinite;
}

@keyframes v2-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
