/* Simulator Styles */
.demo-modal__preview-shell {
    aspect-ratio: 16 / 9;
}

/* GPS Simulator - Waze-like UI (White Theme) */
.sim-gps {
    display: grid;
    grid-template-columns: 1fr 300px;
    height: 100%;
    background: #f0ede8;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.sim-gps__map-wrap {
    position: relative;
    overflow: hidden;
}

.sim-gps__canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.sim-gps__canvas:active {
    cursor: grabbing;
}

.sim-gps__sidebar {
    background: #fff;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

.sim-gps__header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sim-gps__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1f2937;
}

.sim-gps__live-badge {
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    background: #ea4335;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

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

.sim-gps__search {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.sim-gps__search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #333;
    outline: none;
    background: #f9fafb;
}

.sim-gps__search-input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.15);
}

.sim-gps__fleet-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.sim-gps__truck-card {
    position: relative;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 0.3rem;
    border: 1px solid transparent;
}

.sim-gps__truck-card:hover {
    background: #f3f4f6;
}

.sim-gps__truck-card.selected {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.sim-gps__truck-card::before {
    content: '';
    display: block;
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 10px 0 0 10px;
    background: var(--truck-color, #999);
}

.sim-gps__truck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.sim-gps__truck-id {
    font-size: 0.75rem;
    font-weight: 700;
}

.sim-gps__truck-status {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sim-gps__truck-status--active {
    background: #dcfce7;
    color: #16a34a;
}

.sim-gps__truck-status--idle {
    background: #fef9c3;
    color: #ca8a04;
}

.sim-gps__truck-status--offline {
    background: #f3f4f6;
    color: #9ca3af;
}

.sim-gps__truck-driver {
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.sim-gps__truck-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem 0.5rem;
}

.sim-gps__meta-item {
    display: flex;
    justify-content: space-between;
}

.sim-gps__meta-label {
    font-size: 0.62rem;
    color: #9ca3af;
}

.sim-gps__meta-value {
    font-size: 0.62rem;
    color: #374151;
    font-weight: 500;
}

.sim-gps__detail-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    border-radius: 16px 16px 0 0;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.sim-gps__detail-panel.open {
    transform: translateY(0);
}

.sim-gps__detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sim-gps__detail-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1f2937;
}

.sim-gps__detail-close {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: #6b7280;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sim-gps__detail-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.sim-gps__nav-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem;
}

.sim-gps__nav-next {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.sim-gps__nav-icon {
    width: 32px;
    height: 32px;
    background: #4285f4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sim-gps__nav-icon svg {
    width: 18px;
    height: 18px;
}

.sim-gps__nav-instruction {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1f2937;
}

.sim-gps__nav-distance {
    font-size: 0.7rem;
    color: #6b7280;
}

.sim-gps__nav-upcoming {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    padding-left: 0.5rem;
    border-left: 2px solid #e5e7eb;
}

.sim-gps__nav-upcoming div {
    font-size: 0.68rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sim-gps__nav-upcoming .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
}

.sim-gps__nav-upcoming .dot.active {
    background: #4285f4;
}

.sim-gps__eta-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.sim-gps__eta-label {
    font-size: 0.58rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sim-gps__eta-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
}

.sim-gps__controls {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 5;
}

.sim-gps__btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.sim-gps__btn:hover {
    background: #f3f4f6;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.sim-gps__btn svg {
    width: 16px;
    height: 16px;
}

.sim-gps__scale {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.85);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.sim-gps__compass {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #d1d5db;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    z-index: 5;
}

.sim-gps__compass:hover {
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.sim-gps__compass svg {
    width: 18px;
    height: 18px;
}

.sim-gps__alert-banner {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: #374151;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 15;
    white-space: nowrap;
}

.sim-gps__alert-banner.show {
    transform: translateX(-50%) translateY(0);
}

.sim-gps__alert-banner svg {
    flex-shrink: 0;
}

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

.sim-gps__truck-marker.selected {
    animation: truckPulse 1.5s infinite;
}

/* Mobile Simulator */
.sim-mobile {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sim-mobile__frame {
    width: 260px;
    height: 460px;
    background: #1a1a2e;
    border-radius: 32px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.sim-mobile__screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 22px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.sim-mobile__canvas {
    width: 100%;
    height: 160px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #fafafa;
    cursor: crosshair;
}

/* Dashboard Simulator */
.sim-member {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100%;
    background: #0f172a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.sim-member__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-member__add-btn {
    padding: 0.4rem 0.85rem;
    border: none;
    border-radius: 8px;
    background: #00d4ff;
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sim-member__add-btn:hover {
    background: #00ff88;
}

.sim-member__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.sim-member__list {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
}

.sim-member__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sim-member__row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sim-member__row--selected {
    background: rgba(0, 212, 255, 0.08);
}

.sim-member__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sim-member__avatar--lg {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
}

.sim-member__info {
    flex: 1;
    min-width: 0;
}

.sim-member__name {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sim-member__detail {
    display: block;
    font-size: 0.65rem;
    color: #64748b;
}

.sim-member__badge {
    font-size: 0.58rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.sim-member__badge--active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.sim-member__badge--inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.sim-member__badge--new {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
}

.sim-member__detail {
    padding: 1rem;
    overflow-y: auto;
}

.sim-member__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #475569;
    font-size: 0.78rem;
    text-align: center;
    padding: 2rem;
}

.sim-member__detail-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-member__detail-name {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
}

.sim-member__detail-role {
    font-size: 0.72rem;
    color: #64748b;
}

.sim-member__detail-body {
    display: grid;
    gap: 0.85rem;
}

.sim-member__field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sim-member__field span:first-child {
    font-size: 0.72rem;
    color: #64748b;
}

.sim-member__field span:last-child {
    font-size: 0.78rem;
    color: #f1f5f9;
    font-weight: 500;
}

.sim-member__form {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.sim-member__input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.sim-member__input:focus {
    border-color: #00d4ff;
}

.sim-member__input::placeholder {
    color: #475569;
}

.sim-member__submit {
    width: 100%;
    padding: 0.6rem;
    border: none;
    border-radius: 8px;
    background: #00d4ff;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sim-member__submit:hover {
    background: #00ff88;
}
