/* Rush Hour Helper Styles - Minimalist Light Theme */

/* Line 1: Level Selector & Nav Buttons */
#helper-rushhour .rushhour-line-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

#helper-rushhour .rushhour-selectors-group {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

#helper-rushhour .rushhour-selectors-group .select-control {
    flex: 1;
    width: 50%;
    min-width: 0;
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    border-radius: var(--border-radius-sm);
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

#helper-rushhour .rushhour-selectors-group .select-control:focus,
#helper-rushhour .rushhour-selectors-group .select-control:hover {
    border-color: var(--color-primary-accent, #4f46e5);
}

#helper-rushhour .rushhour-nav-btns {
    display: flex;
    gap: 6px;
}

#helper-rushhour .rushhour-nav-btns .btn {
    padding: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
}

/* Line 2: Reset & Undo Buttons + Stat Badges */
#helper-rushhour .rushhour-line-2 {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 20px;
    width: 100%;
}

#helper-rushhour .rushhour-action-btns {
    display: flex;
    gap: 6px;
    align-items: stretch;
    flex: 1;
}

#helper-rushhour .rushhour-action-btns .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-transform: uppercase;
    padding: 0 8px;
    height: 40px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex: 1;
    white-space: nowrap;
    box-sizing: border-box;
}

#helper-rushhour .rushhour-action-btns .btn svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

#helper-rushhour .rushhour-counters {
    display: flex;
    gap: 6px;
    align-items: stretch;
    flex: 1;
}

#helper-rushhour .stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--color-neutral-shaded, rgba(0, 0, 0, 0.03));
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 2px 4px;
    height: 40px;
    min-width: 0;
    flex: 1;
    box-sizing: border-box;
}

#helper-rushhour .stat-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
    line-height: 1.1;
    white-space: nowrap;
}

#helper-rushhour .stat-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.1;
}

/* Rush Hour Board Wrapper */
#helper-rushhour .rushhour-board-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

#helper-rushhour .rushhour-board {
    position: relative;
    width: 100%;
    max-width: 440px;
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    border: 4px solid #cbd5e1;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: visible; /* Allows exit line indicator on right */
}

/* 6x6 Grid Tiles Layer */
#helper-rushhour .grid-tiles-layer {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    width: 100%;
    height: 100%;
}

#helper-rushhour .grid-tile {
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

/* Exit Red Line Indicator (Fixed on right border of Row 2) */
#helper-rushhour .exit-line-indicator {
    position: absolute;
    top: calc(2 * 16.666%); /* Row 2 (3rd row) */
    right: -4px;
    height: 16.666%;
    width: 6px;
    background-color: #ef4444;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    z-index: 5;
}

/* Vehicles Layer & Vehicle Styling */
#helper-rushhour .vehicles-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#helper-rushhour .vehicle {
    position: absolute;
    pointer-events: auto;
    border-radius: 12px;
    padding: 3px;
    box-sizing: border-box;
    transition: top 0.15s ease-out, left 0.15s ease-out;
    user-select: none;
    touch-action: none;
    cursor: grab;
    z-index: 10;
}

#helper-rushhour .vehicle:active,
#helper-rushhour .vehicle.dragging {
    cursor: grabbing;
    transition: none; /* Disable transition during drag for 1:1 movement */
    z-index: 20;
}

#helper-rushhour .vehicle-inner {
    width: 100%;
    height: 100%;
    border-radius: 9px;
    background-color: #C0C0C0;
    border: 2px solid #A0A0A0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
}

/* Main Red Car 'A' */
#helper-rushhour .vehicle-main .vehicle-inner {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 2px solid #fca5a5;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Fixed Obstacle 'x' */
#helper-rushhour .obstacle .vehicle-inner {
    background: #64748b;
    border: 2px solid #475569;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.08), rgba(0,0,0,0.08) 6px, transparent 6px, transparent 12px);
    cursor: not-allowed;
}

/* Loading Overlay */
#helper-rushhour .rushhour-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 30;
}

/* Victory Modal Styling (Same as Sokoban) */
.win-modal-content {
    max-width: 380px;
    width: 90%;
    margin: auto;
    text-align: center;
    padding: 32px 24px;
    box-sizing: border-box;
}

.win-icon-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.win-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--color-text-primary);
}

.win-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.win-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.win-stat-box {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.win-stat-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text-primary);
}

.win-stat-lbl {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.win-actions {
    display: flex;
    gap: 12px;
}

.win-actions .btn {
    flex: 1;
}
