/**
 * Step Navigation Buttons Styling
 */

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

.step-navigation .btn-prev,
.step-navigation .btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid #146AFF;
    background-color: #ffffff;
    color: #146AFF;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
}

.step-navigation .btn-prev:hover,
.step-navigation .btn-next:hover {
    background-color: #146AFF;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 106, 255, 0.3);
}

.step-navigation .btn-prev svg,
.step-navigation .btn-next svg {
    transition: transform 0.3s ease;
}

.step-navigation .btn-prev:hover svg {
    transform: translateX(-4px);
}

.step-navigation .btn-next:hover svg {
    transform: translateX(4px);
}

/* Next button - primary style */
.step-navigation .btn-next {
    background-color: #146AFF;
    color: #ffffff;
    margin-left: auto;
}

.step-navigation .btn-next:hover {
    background-color: #0d4ec4;
    border-color: #0d4ec4;
}

/* Disabled state */
.step-navigation .btn-prev:disabled,
.step-navigation .btn-next:disabled {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.step-navigation .btn-prev:disabled:hover,
.step-navigation .btn-next:disabled:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
    transform: none;
    box-shadow: none;
}

.step-navigation .btn-prev:disabled svg,
.step-navigation .btn-next:disabled svg {
    opacity: 0.5;
}

/* Enabled state animation */
.step-navigation .btn-next.enabled {
    animation: pulse-enabled 0.5s ease;
}

@keyframes pulse-enabled {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Previous button alignment */
.step-navigation .btn-prev {
    margin-right: auto;
}

/* Step 3 specific buttons */
.step-navigation .btn-edit {
    background-color: #ffffff;
    border-color: #146AFF;
    color: #146AFF;
}

.step-navigation .btn-edit:hover {
    background-color: #f0f7ff;
    border-color: #0d4ec4;
    color: #0d4ec4;
}

.step-navigation .btn-confirm {
    background-color: #146AFF;
    color: #ffffff;
    margin-left: auto;
}

.step-navigation .btn-confirm:hover {
    background-color: #0d4ec4;
    border-color: #0d4ec4;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .step-navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: #ffffff;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        margin: 0;
        padding: 20px;
        border-top: none;
        flex-direction: row;
        gap: 12px;
    }
    
    .step-navigation .btn-prev,
    .step-navigation .btn-next {
        margin: 0;
        flex: 1;
        font-size: 18px;
        font-weight: 600;
        padding: 16px 24px;
        border-radius: 50px;
        min-height: 56px;
    }
    
    /* Next button - full width */
    .step-navigation .btn-next {
        flex: 1;
    }
    
    /* Previous button - smaller */
    .step-navigation .btn-prev {
        flex: 0 0 auto;
        min-width: 120px;
        background: #f3f4f6;
        border-color: #d1d5db;
        color: #6b7280;
    }
    
    .step-navigation .btn-prev:hover {
        background: #e5e7eb;
        border-color: #9ca3af;
    }
    
    /* เพิ่ม padding ด้านล่างให้ content ไม่ถูกบังโดย sticky bar */
    .main-content,
    #transfer-list,
    .transfer-list {
        padding-bottom: 120px;
    }
}

/* Integration with existing sections - ตำแหน่งเดียวกันทุก step */
.main-content .step-navigation,
#transfer-list .step-navigation,
.transfer-list .step-navigation {
    margin: 40px 0 0 0;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    border-bottom: none;
}

/* Step 1 specific - ให้ปุ่มอยู่ด้านล่างสุดและเต็มความกว้าง */
.main-content .step-navigation {
    width: 100%;
    flex-basis: 100%; /* ให้ขยายเต็มแถว */
    order: 999; /* ให้อยู่ล่างสุด */
}

/* Loading state */
.step-navigation .btn-prev.loading,
.step-navigation .btn-next.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.step-navigation .btn-prev.loading::after,
.step-navigation .btn-next.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Success state */
.step-navigation .btn-next.success {
    background-color: #10b981;
    border-color: #10b981;
}

.step-navigation .btn-next.success:hover {
    background-color: #059669;
    border-color: #059669;
}

/* Error state */
.step-navigation .btn-next.error {
    background-color: #ef4444;
    border-color: #ef4444;
}

.step-navigation .btn-next.error:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

/* Tooltip for disabled state */
.step-navigation .btn-next[disabled]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: #1f2937;
    color: #ffffff;
    font-size: 14px;
    font-weight: 400;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    margin-bottom: 8px;
    pointer-events: none;
}

.step-navigation .btn-next[disabled]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Car selection indicator */
.step-navigation .selection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.step-navigation .selection-status.selected {
    color: #10b981;
}

.step-navigation .selection-status svg {
    width: 20px;
    height: 20px;
}
