/* Store Selection Screen - Dark Grid Theme (Reference Replication) */
.store-selection-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0d1117;
    /* Deep dark background */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    /* Grid size */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.selection-content {
    width: 100%;
    max-width: 1200px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header Area */
.selection-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.selection-icon {
    width: 60px;
    height: 60px;
    background-color: #0f1621;
    border: 1px solid #1e293b;
    border-radius: 16px;
    color: #10b981;
    /* Primary Green */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.selection-icon svg {
    color: #10b981;
}

.selection-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    color: white;
}

.selection-header h1 span {
    color: #10b981;
    /* "Store" is green */
}

.selection-header p {
    color: #64748b;
    font-size: 16px;
}

/* Grid Layout */
.selection-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    padding: 0 20px;
}

/* STORE CARD (The "Active" Stores) */
.store-card {
    background-color: #0f131a;
    /* Dark Card Bg */
    border: 1px solid #1e293b;
    border-radius: 20px;
    padding: 24px;
    width: 340px;
    min-height: 240px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.store-card:not(.add-new):hover {
    border-color: #2e3c50;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

/* Header inside Card */
.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.store-icon-wrapper {
    position: relative;
}

.store-icon {
    width: 48px;
    height: 48px;
    background-color: #1e293b;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

/* Active Badge (Capsule style) */
.store-badge {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

/* Store Info */
.store-info {
    margin-bottom: 24px;
}

.store-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
}

.store-location {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Stats Row (Two boxes side by side) */
.store-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-box {
    background-color: #161b22;
    border: 1px solid #252d3d;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-icon-small {
    color: #64748b;
    opacity: 0.7;
}

.stat-text {
    display: flex;
    flex-direction: column;
}

.stat-text .lbl {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.stat-text .val {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

/* Footer Link */
.store-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.store-card:hover .store-footer {
    opacity: 1;
}

.arrow-icon {
    transition: transform 0.2s;
}

.store-card:hover .arrow-icon {
    transform: translateX(4px);
}

/* "ADD NEW STORE" Card */
.store-card.add-new {
    background-color: transparent;
    border: 2px dashed #334155;
    align-items: center;
    justify-content: center;
    background-image: none;
    /* No grid bg inside */
}

.store-card.add-new .add-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.add-icon-circle {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: #94a3b8;
    background: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.store-card.add-new:hover {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.02);
}

.store-card.add-new:hover .add-icon-circle {
    background-color: #10b981;
    color: #0f131a;
}

.add-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
}

.add-subtitle {
    font-size: 12px;
    color: #64748b;
}

/* --- WIZARD MODAL STYLES MOVED TO views/storeSetup/wizard.css --- */

.store-wizard-card {
    max-width: 900px;
    width: 90%;
    height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: #0f131a;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
    position: relative;
}

.wizard-header {
    background-color: #0f131a;
    padding: 30px 40px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.wizard-header h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: white;
}

.wizard-steps {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.5;
    transition: all 0.3s;
}

.step-indicator span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #1e293b;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.step-indicator.active {
    opacity: 1;
    color: #10b981;
}

.step-indicator.active span {
    background-color: #10b981;
    color: #0f131a;
}

.step-line {
    flex: 1;
    height: 2px;
    background-color: #1e293b;
    margin-top: -16px;
    min-width: 30px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.close-modal {
    background: none;
    border: none;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
}

.close-modal:hover {
    color: white;
}

.wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background-color: #0d1117;
}

.wizard-footer {
    padding: 20px 40px;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    background-color: #0f131a;
}

/* Spinner */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #64748b;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(16, 185, 129, 0.1);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* --- WIZARD MODAL STYLES (UPDATED) --- */
/* Force High Z-Index to appear ABOVE Selection Screen */
#storeWizardModal {
    z-index: 9999 !important;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-wizard-card {
    max-width: 900px;
    width: 90%;
    height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: #1a1d29;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    position: relative;
}

.wizard-header {
    background-color: #1a1d29;
    padding: 30px 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.wizard-header h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: white;
}

.wizard-steps {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.5;
    transition: all 0.3s;
}

.step-indicator span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.step-indicator.active {
    opacity: 1;
    color: var(--accent-green);
}

.step-indicator.active span {
    background-color: var(--accent-green);
    color: #1a1d29;
}

.step-indicator.completed span {
    background-color: var(--accent-green);
    color: #1a1d29;
}

.step-line {
    flex: 1;
    height: 2px;
    background-color: var(--border-color);
    margin-top: -16px;
    min-width: 30px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.close-modal:hover {
    color: white;
}

.wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background-color: #1a1d29;
}

.wizard-footer {
    padding: 20px 40px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    background-color: #1a1d29;
}

/* --- WIZARD FORM INPUTS (Target Design) --- */
.wizard-body input[type="text"],
.wizard-body input[type="email"],
.wizard-body input[type="tel"],
.wizard-body input[type="number"],
.wizard-body select {
    width: 100%;
    padding: 12px 16px;
    background-color: #252936;
    /* Darker input bg */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    margin-top: 5px;
    outline: none;
    transition: all 0.2s;
}

.wizard-body input:focus,
.wizard-body select:focus {
    border-color: var(--accent-green);
    background-color: #2d3142;
}

.wizard-body label {
    display: block;
    font-size: 13px;
    color: #a0a3bd;
    /* Text secondary */
    font-weight: 600;
    margin-bottom: 2px;
}

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

/* Icon Inputs */
.icon-input .input-wrapper {
    position: relative;
}

.icon-input .input-wrapper input {
    padding-left: 40px;
    margin-top: 5px;
}

.prefix-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) translateY(2px);
    /* Adjust for margin */
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

/* STEP 1 Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid.layout-step1 .full-width {
    grid-column: 1 / -1;
}

.form-section-title {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

/* STEP 2: Niche Cards */
.niches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.niche-card {
    background-color: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.niche-card:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.niche-card.selected {
    border-color: var(--accent-green);
    background-color: rgba(123, 237, 159, 0.05);
}

.niche-icon {
    font-size: 28px;
    margin-bottom: 5px;
}

.niche-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.niche-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* STEP 3: Integrations (List) */
.integrations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.integration-item {
    background-color: var(--bg-secondary);
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.integration-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.integration-logo-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 20px;
}

.integration-logo-box.dropi {
    background-color: #00d2aa;
}

.integration-logo-box.mastershop {
    background-color: #2b6cb0;
}

.integration-logo-box.woocommerce {
    background-color: #7f54b3;
}

.integration-logo-box.shopify {
    background-color: #96bf48;
}

.integration-logo-box.mercadolibre {
    background-color: #ffe600;
    color: #333;
}

.integration-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

/* IMPROVED CONNECT BUTTONS */
.btn-connect {
    padding: 8px 16px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-connect:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background-color: rgba(123, 237, 159, 0.05);
}

.btn-connect.connected {
    background-color: rgba(123, 237, 159, 0.1);
    border-color: var(--accent-green);
    color: var(--accent-green);
    cursor: default;
}

/* STEP 4: Import */
.import-search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    align-items: center;
    /* Ensure they align vertically */
}

.import-search-box .btn-primary {
    width: auto !important;
    margin-top: 0 !important;
    padding: 0 40px;
    height: 54px;
    /* Match input approximate height */
    font-size: 16px;
}

.big-search-input {
    flex: 1;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    font-size: 18px;
    /* Larger text */
    height: 54px;
    /* Fixed height for alignment */
}

.import-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-import-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.product-import-card:hover {
    transform: translateY(-2px);
}

.product-import-card.selected {
    border-color: var(--accent-green);
}

.check-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    background-color: var(--accent-green);
    color: #1a1d29;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
    height: 24px;
}

.product-import-card.selected .check-indicator {
    opacity: 1;
    transform: scale(1);
}

.prod-img-placeholder {
    height: 140px;
    background-color: #2d3142;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.prod-info-box {
    padding: 15px;
}

.prod-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prod-price {
    color: var(--accent-green);
    font-weight: 700;
}

.empty-import-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
}

.wizard-step-title.centered {
    text-align: center;
    margin-bottom: 40px;
}

.wizard-step-title h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.wizard-step-title p {
    color: var(--text-secondary);
}

/* Modal Overlay & General Card Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.integration-card {
    background: #1a1d29;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 440px;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.status-message {
    transition: all 0.3s ease;
}