/**
 * Mobile Form Wizard CSS
 *
 * Styles for multi-step form wizard on mobile devices.
 */

/* ==========================================================================
   Base Wizard Styles (Mobile Only)
   ========================================================================== */

@media (max-width: 768px) {
    .mobile-wizard {
        position: relative;
    }

    /* Progress Bar */
    .wizard-progress {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0;
        margin-bottom: 20px;
        position: relative;
    }

    .wizard-progress::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 10%;
        right: 10%;
        height: 2px;
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-50%);
        z-index: 0;
    }

    .wizard-progress-step {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        position: relative;
        z-index: 1;
        cursor: pointer;
        padding: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .wizard-progress-step .step-number {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.5);
        transition: all 0.3s ease;
    }

    .wizard-progress-step .step-title {
        font-size: 10px;
        color: rgba(255, 255, 255, 0.4);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        max-width: 80px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .wizard-progress-step.active .step-number {
        background: var(--accent-cyan, #00cfff);
        border-color: var(--accent-cyan, #00cfff);
        color: #000;
        box-shadow: 0 0 20px rgba(0, 207, 255, 0.4);
    }

    .wizard-progress-step.active .step-title {
        color: var(--accent-cyan, #00cfff);
    }

    .wizard-progress-step.completed .step-number {
        background: var(--accent-green, #00ff88);
        border-color: var(--accent-green, #00ff88);
        color: #000;
    }

    .wizard-progress-step.completed .step-number::after {
        content: '\2713';
        font-size: 16px;
    }

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

    /* Wrapper for Steps */
    .wizard-wrapper {
        position: relative;
        overflow: hidden;
    }

    /* Individual Steps */
    .wizard-step {
        display: none;
        padding: 0;
        animation: fadeIn 0.3s ease;
    }

    .wizard-step.active {
        display: block;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateX(20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Navigation Buttons */
    .wizard-nav {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 20px 0;
        margin-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        position: sticky;
        bottom: 0;
        background: inherit;
        z-index: 10;
    }

    .wizard-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 52px;
        padding: 14px 20px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        border: none;
    }

    .wizard-btn svg {
        width: 20px;
        height: 20px;
    }

    .wizard-prev {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .wizard-prev:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    .wizard-prev:not(:disabled):active {
        background: rgba(255, 255, 255, 0.15);
    }

    .wizard-next {
        background: linear-gradient(135deg, var(--accent-cyan, #00cfff) 0%, #0099cc 100%);
        color: #000;
        font-weight: 700;
    }

    .wizard-next:active {
        transform: scale(0.98);
    }

    /* Validation Error */
    .wizard-error {
        background: rgba(255, 68, 68, 0.15);
        border: 1px solid rgba(255, 68, 68, 0.4);
        border-radius: 10px;
        padding: 12px 16px;
        margin-bottom: 16px;
        font-size: 14px;
        color: #ff6666;
        animation: shake 0.4s ease;
    }

    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

    /* Invalid Fields */
    .mobile-wizard input.invalid,
    .mobile-wizard select.invalid,
    .mobile-wizard textarea.invalid {
        border-color: #ff4444 !important;
        box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.2);
    }

    /* Form Group Styles Inside Wizard */
    .mobile-wizard .form-group {
        margin-bottom: 20px;
    }

    .mobile-wizard .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.7);
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-wizard .form-group input,
    .mobile-wizard .form-group select,
    .mobile-wizard .form-group textarea {
        width: 100%;
        min-height: 48px;
        padding: 14px 16px;
        font-size: 16px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 10px;
        color: #fff;
        -webkit-appearance: none;
        appearance: none;
    }

    .mobile-wizard .form-group input:focus,
    .mobile-wizard .form-group select:focus,
    .mobile-wizard .form-group textarea:focus {
        outline: none;
        border-color: var(--accent-cyan, #00cfff);
        box-shadow: 0 0 0 3px rgba(0, 207, 255, 0.15);
    }

    .mobile-wizard .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }

    /* Native Date/Time Pickers */
    .mobile-wizard input[type="date"],
    .mobile-wizard input[type="time"],
    .mobile-wizard input[type="datetime-local"] {
        min-height: 48px;
    }

    /* Select Dropdown Arrow */
    .mobile-wizard select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 18px;
        padding-right: 40px;
    }
}

/* ==========================================================================
   Step Content Specific Styles
   ========================================================================== */

@media (max-width: 768px) {
    /* Step Header */
    .wizard-step-header {
        margin-bottom: 24px;
    }

    .wizard-step-header h3 {
        font-size: 20px;
        font-weight: 600;
        color: #fff;
        margin-bottom: 8px;
    }

    .wizard-step-header p {
        font-size: 14px;
        color: rgba(255, 255, 255, 0.6);
        line-height: 1.5;
    }

    /* Help Text */
    .wizard-help-text {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.5);
        margin-top: 6px;
    }

    /* Required Indicator */
    .wizard-required {
        color: #ff6666;
        margin-left: 4px;
    }

    /* Review Step */
    .wizard-review {
        background: rgba(255, 255, 255, 0.03);
        border-radius: 12px;
        padding: 16px;
    }

    .wizard-review-item {
        display: flex;
        justify-content: space-between;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .wizard-review-item:last-child {
        border-bottom: none;
    }

    .wizard-review-label {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.6);
    }

    .wizard-review-value {
        font-size: 14px;
        font-weight: 500;
        color: #fff;
        text-align: right;
    }
}

/* ==========================================================================
   Desktop - Hide Wizard UI
   ========================================================================== */

@media (min-width: 769px) {
    .wizard-progress,
    .wizard-nav,
    .wizard-error {
        display: none !important;
    }

    .wizard-step {
        display: block !important;
    }

    .mobile-wizard {
        /* Reset any mobile-specific styles */
    }
}

/* ==========================================================================
   Dark Theme Support
   ========================================================================== */

@media (max-width: 768px) {
    .mobile-wizard {
        --wizard-bg: rgba(10, 14, 23, 0.95);
        --wizard-border: rgba(0, 150, 255, 0.2);
        --wizard-text: #fff;
        --wizard-text-muted: rgba(255, 255, 255, 0.6);
    }
}

/* ==========================================================================
   Specific Form Type Overrides
   ========================================================================== */

@media (max-width: 768px) {
    /* Launch Market Form */
    .launch-market-form.mobile-wizard .wta-input,
    .launch-token-form.mobile-wizard .wta-input {
        font-size: 16px !important;
        min-height: 48px;
    }

    /* Asset Selection */
    .mobile-wizard .asset-select-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .mobile-wizard .asset-chip {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 14px;
        text-align: center;
    }

    /* Token Allocation Slider */
    .mobile-wizard .allocation-slider {
        width: 100%;
        height: 44px;
    }

    /* Checkbox Groups */
    .mobile-wizard .checkbox-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-wizard .checkbox-group label {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 44px;
        padding: 8px 0;
    }

    .mobile-wizard .checkbox-group input[type="checkbox"] {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }
}
