/**
 * Stops Panel Styles
 * Right-side slide-out panel for unauthorized stops overlay on the map tab.
 * Mirrors truck-panel.css patterns (position, transitions, dark theme).
 */

/* Panel Container - right side, hidden by default */
.stops-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(12px);
    border-left: 1px solid var(--border-primary);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 21;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

.stops-panel.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

/* Inner wrapper */
.stops-panel-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Panel Header */
.stops-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(30, 41, 59, 0.6);
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.stops-panel-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.stops-panel-header-title i {
    color: #f85149;
}

.stops-panel-count {
    background: #f85149;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
}

.stops-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 5px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.stops-panel-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Date Picker Row */
.stops-panel-date {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.stops-panel-date-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.stops-panel-date-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.stops-panel-date-input {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.stops-panel-date-input:focus {
    border-color: var(--accent);
}

/* Toggle Row */
.stops-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.stops-panel-toggle label {
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stops-panel-toggle input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

/* Stops List Container */
.stops-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.stops-panel-list::-webkit-scrollbar {
    width: 5px;
}

.stops-panel-list::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.stops-panel-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Individual Stop Card */
.stops-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-left: 3px solid #f85149;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.stops-list-item:hover {
    border-color: rgba(248, 81, 73, 0.5);
    border-left-color: #f85149;
    background: rgba(248, 81, 73, 0.08);
}

.stops-list-item.active {
    border-color: #f85149;
    border-left-color: #f85149;
    background: rgba(248, 81, 73, 0.15);
    box-shadow: 0 0 0 1px #f85149;
}

.stops-list-item.authorized {
    border-left-color: var(--status-active);
}

.stops-list-item.authorized:hover {
    border-color: rgba(63, 185, 80, 0.5);
    border-left-color: var(--status-active);
    background: rgba(63, 185, 80, 0.08);
}

.stops-list-item.authorized.active {
    border-color: var(--status-active);
    border-left-color: var(--status-active);
    background: rgba(63, 185, 80, 0.15);
    box-shadow: 0 0 0 1px var(--status-active);
}

/* Near-geofence (orange) */
.stops-list-item.near {
    border-left-color: #f0883e;
}

.stops-list-item.near:hover {
    border-color: rgba(240, 136, 62, 0.5);
    border-left-color: #f0883e;
    background: rgba(240, 136, 62, 0.08);
}

.stops-list-item.near.active {
    border-color: #f0883e;
    border-left-color: #f0883e;
    background: rgba(240, 136, 62, 0.15);
    box-shadow: 0 0 0 1px #f0883e;
}

/* Stop Number Badge */
.stop-number {
    width: 24px;
    height: 24px;
    background: #f85149;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.stops-list-item.authorized .stop-number {
    background: var(--status-active);
}

.stops-list-item.near .stop-number {
    background: #f0883e;
}

/* Stop Info */
.stop-info {
    flex: 1;
    min-width: 0;
}

.stop-truck-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.stop-time-range {
    font-size: 11px;
    color: var(--text-secondary);
}

.stop-address {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Duration Badge */
.stop-duration {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.stops-list-item.authorized .stop-duration {
    background: rgba(63, 185, 80, 0.15);
    color: var(--status-active);
}

.stops-list-item.near .stop-duration {
    background: rgba(240, 136, 62, 0.15);
    color: #f0883e;
}

/* Loading State */
.stops-panel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Empty State */
.stops-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.stops-panel-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.stops-panel-empty p {
    font-size: 13px;
    margin: 0;
}

/* Stop sign header button - active state */
.stops-btn.active {
    background: rgba(248, 81, 73, 0.2) !important;
    border-color: #f85149 !important;
}

/* Responsive */
@media (max-width: 480px) {
    .stops-panel {
        width: 100%;
    }
}
