/**
 * Moon Omens Checkout Navigation Styles
 * Version: 1.0
 * 
 * Styles for the 3-step progress indicator across checkout flow
 * 
 * INSTALLATION:
 * Add to your theme's main stylesheet or enqueue separately
 * Ensure this loads after your theme's base styles
 */

/* =============================================
   NAVIGATION CONTAINER
   ============================================= */

.form-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 24px;
    position: relative;
    max-width: 100%;
    opacity: 0.9;
}

/* Specific styling for injected navigation */
.form-navigation.checkout-nav-injected {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
}

/* =============================================
   BACK BUTTON
   ============================================= */

.form-navigation .back-button {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
    width: 60px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    background: transparent;
}

.form-navigation .back-button:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.form-navigation .back-button:active {
    transform: translateX(-2px);
}

.form-navigation .back-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

/* =============================================
   PROGRESS INDICATOR
   ============================================= */

.progress-indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0; /* Allow flex shrinking */
}

/* =============================================
   PROGRESS STEPS (CIRCLES & LINES)
   ============================================= */

.progress-steps {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

/* Step Circle */
.progress-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    z-index: 2;
}

/* Active Step */
.progress-step.active {
    background: rgba(212, 175, 125, 0.15);
    border-color: rgba(212, 175, 125, 0.5);
    color: rgba(212, 175, 125, 1);
    box-shadow: 0 0 0 3px rgba(212, 175, 125, 0.08);
}

/* Completed Step */
.progress-step.completed {
    background: rgba(212, 175, 125, 0.2);
    border-color: rgba(212, 175, 125, 0.6);
    color: rgba(212, 175, 125, 1);
}

/* Step Number */
.progress-step .step-number {
    display: block;
    line-height: 1;
}

.progress-step.completed .step-number {
    display: none;
}

/* Checkmark Icon */
.progress-step .checkmark {
    display: none;
    width: 16px;
    height: 16px;
}

.progress-step.completed .checkmark {
    display: block;
    animation: checkmarkPop 0.3s ease;
}

.progress-step.completed .checkmark path {
    stroke: rgba(212, 175, 125, 1);
}

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

/* Connecting Line */
.progress-line {
    width: 60px;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.progress-line.completed {
    background: rgba(212, 175, 125, 0.4);
}

/* =============================================
   PROGRESS LABEL
   ============================================= */

.progress-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    font-weight: 400;
    text-align: center;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* =============================================
   SPACER (RIGHT SIDE)
   ============================================= */

.form-navigation .spacer {
    width: 60px;
    flex-shrink: 0;
}

/* =============================================
   RESPONSIVE STYLES
   ============================================= */

/* Tablets */
@media (max-width: 768px) {
    .form-navigation {
        padding: 20px 0;
        margin-bottom: 24px;
    }
    
    .progress-step {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .progress-step .checkmark {
        width: 16px;
        height: 16px;
    }
    
    .progress-line {
        width: 60px;
    }
    
    .progress-label {
        font-size: 13px;
    }
    
    .form-navigation .back-button {
        font-size: 13px;
        width: 60px;
        padding: 6px 10px;
    }
    
    .form-navigation .spacer {
        width: 60px;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .form-navigation {
        padding: 16px 0;
        margin-bottom: 20px;
    }
    
    .progress-step {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .progress-step.active {
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    }
    
    .progress-step .checkmark {
        width: 14px;
        height: 14px;
    }
    
    .progress-line {
        width: 40px;
    }
    
    .progress-label {
        font-size: 12px;
        max-width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .form-navigation .back-button {
        font-size: 12px;
        width: 50px;
        padding: 6px 8px;
        gap: 6px;
    }
    
    .form-navigation .back-button span {
        /* Hide text on very small screens, keep icon */
        display: none;
    }
    
    .form-navigation .back-button svg {
        width: 18px;
        height: 18px;
    }
    
    .form-navigation .spacer {
        width: 50px;
    }
}

/* Very Small Phones */
@media (max-width: 360px) {
    .progress-step {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .progress-line {
        width: 30px;
    }
    
    .progress-label {
        font-size: 11px;
        max-width: 180px;
    }
    
    .form-navigation .back-button {
        width: 40px;
        padding: 4px 6px;
    }
    
    .form-navigation .spacer {
        width: 40px;
    }
}

/* =============================================
   DARK BACKGROUND COMPATIBILITY
   ============================================= */

/* If page has light background, adjust colors */
.light-bg .form-navigation .back-button,
.light-bg .progress-label {
    color: #333;
}

.light-bg .progress-step {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.4);
}

.light-bg .progress-line {
    background: rgba(0, 0, 0, 0.15);
}

/* Active/completed steps stay green regardless */
.light-bg .progress-step.active,
.light-bg .progress-step.completed {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

.light-bg .progress-line.completed {
    background: #4CAF50;
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    .form-navigation {
        display: none;
    }
}

/* =============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================= */

/* Focus states for keyboard navigation */
.form-navigation .back-button:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .progress-step {
        border-width: 3px;
    }
    
    .progress-step.active {
        border-color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .progress-step,
    .progress-line,
    .form-navigation .back-button {
        transition: none;
    }
    
    .progress-step.completed .checkmark {
        animation: none;
    }
    
    .progress-step.active {
        transform: none;
    }
}

/* =============================================
   LOADING STATE (OPTIONAL)
   ============================================= */

.form-navigation.loading {
    opacity: 0.6;
    pointer-events: none;
}

.form-navigation.loading .progress-step.active {
    animation: pulse 1.5s ease-in-out infinite;
}

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