/* Vehicle Commands Styles */

/* Command Rail - Horizontal glass rail next to the toggle button */
.command-rail {
    position: fixed;
    top: 328px; /* Position at the same height as the last rail button */
    left: 90px; /* Position right after the left rail (64px width + 16px margin) */
    width: 200px; /* Same width as rail buttons */
    height: 58px; /* Same height as rail buttons */
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border-radius: 12px; /* Same radius as rail buttons */
    background-clip: padding-box;
    overflow: hidden;
    isolation: isolate;
    z-index: 950;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 10px;
}

.command-rail.visible {
    transform: translateX(0);
    opacity: 1;
}

/* Rail Command Buttons */
.rail-command-btn {
    width: 48px; /* Same as rail-btn */
    height: 48px; /* Same as rail-btn */
    border-radius: 12px; /* Same as rail-btn */
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease; /* Same as rail-btn */
    position: relative;
    overflow: hidden;
}

.rail-command-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rail-command-btn:active:not(:disabled) {
    transform: translateY(0);
}

.rail-command-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Command button variants */
.rail-command-btn-danger {
    color: #ef4444;
}

.rail-command-btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.rail-command-btn-success {
    color: #10b981;
}

.rail-command-btn-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.rail-command-btn-primary {
    color: #3b82f6;
}

.rail-command-btn-primary:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

/* Loading state for rail buttons */
.rail-command-btn.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Disabled state for command button */
.rail-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 768px) {
    .command-rail {
        left: 76px; /* Adjust for smaller rail on mobile */
        height: 40px;
        padding: 0 6px;
        gap: 2px;
    }

    .rail-command-btn {
        width: 32px;
        height: 32px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .command-rail {
        background: rgba(31, 41, 55, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
}
