/* =========================================================================
   AI8GHT CUSTOM AI WEB BUILDER STYLESHEET
   ========================================================================= */

.builder-page-wrapper {
    min-height: calc(100vh - 80px);
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
                var(--bg-main);
    padding: 40px 0 100px;
}

/* Multi-Step Top Progress Tracker */
.builder-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    max-width: 960px;
    margin: 0 auto 48px;
    padding: 0 16px;
}

.builder-stepper::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border-light);
    z-index: 1;
}

.stepper-line-fill {
    position: absolute;
    top: 24px;
    left: 40px;
    height: 2px;
    background: var(--primary);
    transition: width 0.35s ease;
    z-index: 2;
}

.step-node {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
}

.step-bubble {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-card);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.step-node.active .step-bubble {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.45);
    transform: scale(1.08);
}

.step-node.completed .step-bubble {
    border-color: var(--success);
    background: var(--success);
    color: #ffffff;
}

.step-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.step-node.active .step-text {
    color: var(--text-heading);
    font-weight: 700;
}

/* Builder Layout Container */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.builder-layout.with-preview {
    grid-template-columns: 1fr 1fr;
}

/* Form Card */
.builder-card {
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    position: relative;
}

.builder-card-header {
    margin-bottom: 32px;
}

.builder-card-header h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.builder-card-header p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

/* Industry Selection Grid (No Google API) */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.industry-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.industry-card:hover {
    border-color: rgba(37, 99, 235, 0.4);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.industry-card.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.2);
}

.industry-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.industry-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.industry-card.selected .industry-icon {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.industry-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-heading);
}

.industry-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Form Groups & Inputs */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 8px;
    color: var(--text-heading);
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-heading);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    background: rgba(0, 0, 0, 0.35);
}

/* Service Item Repeater */
.service-items-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.service-item-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1.4fr 2fr 1fr auto;
    gap: 12px;
    align-items: center;
}

.btn-remove-service {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-remove-service:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-add-service {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--border-light);
    border-radius: 8px;
    padding: 10px 18px;
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-service:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

/* Trust Signals Checkbox Group */
.trust-checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.trust-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trust-checkbox-label:hover {
    border-color: rgba(37, 99, 235, 0.4);
}

.trust-checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Step 3: Layout Cards */
.layout-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.layout-card {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.layout-card:hover {
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.layout-card.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.2);
}

.layout-card-wireframe {
    height: 100px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 8px;
    overflow: hidden;
}

.wireframe-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.wireframe-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex-grow: 1;
}

.wireframe-box {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

/* Color Scheme Swatches */
.color-swatches-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.color-swatch-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-light);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-swatch-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.color-swatch-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.08);
}

.swatch-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 auto 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.swatch-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-heading);
}

/* Live Preview Frame */
.builder-preview-container {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    min-height: 680px;
    position: sticky;
    top: 100px;
}

.preview-bar {
    background: rgba(10, 15, 29, 0.95);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-dots {
    display: flex;
    gap: 6px;
}

.preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.preview-address-bar {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 4px 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-device-toggle {
    display: flex;
    gap: 8px;
}

.btn-device {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.btn-device:hover, .btn-device.active {
    color: var(--primary);
}

.preview-frame {
    flex-grow: 1;
    width: 100%;
    height: 600px;
    border: none;
    background: #0a0f1d;
    transition: width 0.3s ease;
}

.preview-frame.mobile {
    width: 375px;
    margin: 0 auto;
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
}

/* Step Navigation Footer */
.builder-nav-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

/* Step 4: Summary Card */
.summary-review-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 28px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.92rem;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--text-muted);
}

.summary-val {
    font-weight: 600;
    color: var(--text-heading);
}

/* Step 5: Deployed Launch Telemetry Screen */
.deploy-success-box {
    text-align: center;
    padding: 40px 20px;
}

.deploy-ring-pulse {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.35);
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.subdomain-display-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 1.25rem;
    font-family: monospace;
    font-weight: 700;
    color: #ffffff;
    margin: 20px 0 28px;
}

.btn-copy-url {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: transform 0.2s ease;
}

.btn-copy-url:hover {
    transform: scale(1.15);
}

.launch-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 0 auto 32px;
}

.telemetry-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
}

.telemetry-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
    font-family: var(--font-heading);
}

.telemetry-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Custom Sleek Modal / Toast (Strict compliance with Rule #3) */
.builder-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.builder-toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 14px 20px;
    color: #ffffff;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toastSlideIn 0.3s ease;
}

.builder-toast.success {
    border-color: #10b981;
}

.builder-toast.error {
    border-color: #ef4444;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 980px) {
    .builder-layout.with-preview {
        grid-template-columns: 1fr;
    }
    .industry-grid {
        grid-template-columns: 1fr;
    }
    .layout-picker-grid {
        grid-template-columns: 1fr;
    }
    .color-swatches-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .service-item-row {
        grid-template-columns: 1fr;
    }
    .builder-preview-container {
        display: none; /* Hide sticky preview on mobile/tablet to give full focus to steps */
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
