/* ============================================================
   WEBIMPULSER PRO - "WOW" REDESIGN (FINAL ROBUST VERSION)
   ============================================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg-body: #f1f5f9;
    --bg-white: #ffffff;
    --text-main: #1e293b;
    --text-light: #64748b;
    --border-light: #e2e8f0;
    --radius: 0px;
}

body {
    background-color: var(--bg-body);
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    margin: 0;
    overflow-x: hidden;
}

/* 1. LAYOUT STRUCTURE (FLEX ROW) */
.studio-layout {
    display: flex;
    flex-direction: row;
    min-height: calc(100vh - 100px);
    width: 100%;
    margin-top: 0;
    padding: 30px;
    box-sizing: border-box;
    gap: 30px;
    align-items: flex-start;
    /* Important for independent heights */
}

/* 2. SIDEBAR (Fixed Width) */
.studio-content-sidebar {
    width: 260px;
    flex-shrink: 0;
    /* NEVER SHRINK */
    background: var(--bg-white);
    border-radius: 0px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.studio-icon-sidebar {
    display: none !important;
}

/* 3. WORKSPACE (Variable Width) */
.studio-workspace {
    flex: 1;
    /* GROWS to fill space */
    min-width: 0;
    /* Prevents overflow issues */
    background: var(--bg-white);
    border-radius: 0px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 40px;
}

/* 4. PREVIEW (Fixed Width - RIGHT) */
.studio-preview {
    width: 400px;
    flex-shrink: 0;
    /* NEVER SHRINK */
    background: var(--bg-white);
    border-radius: 0px;
    padding: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 8px solid #1e293b;
    /* Mockup Frame Border */
    height: 800px;
    position: sticky;
    top: 30px;
    overflow: hidden;
}

/* Phone Screen Internal */
#preview-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 0px;
    overflow: hidden;
}

/* 5. TYPOGRAPHY & ELEMENTS */
.content-sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.content-sidebar-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.content-sidebar-header p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 4px 0 0 0;
}

.sidebar-step-item {
    padding: 12px 16px;
    border-radius: 0px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-step-item:hover {
    background: #f8fafc;
    transform: translateX(5px);
}

.sidebar-step-item.active {
    background: #e0e7ff;
    color: var(--primary);
}

.sidebar-step-item i {
    color: var(--text-light);
    transition: color 0.2s;
}

.sidebar-step-item.active i {
    color: var(--primary);
}

.step-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.step-num {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Styling for Forms */
.minimalist-connect-card {
    background: #fff;
    max-width: 100%;
}

.pane-title-group h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 30px;
    color: var(--text-main);
}

/* Form Styles */
/* Form Layout Grid */
.connect-form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-column-separator {
    border-top: 1px solid var(--border-light);
    padding-top: 30px;
    margin-top: 10px;
}

.form-step-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

/* Prefix Input Styling */
.input-with-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: #fff;
    transition: all 0.2s;
}

.input-with-prefix:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.prefix-text {
    padding: 0 16px;
    background: #f8fafc;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.9rem;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-light);
}

.input-with-prefix input {
    border: none !important;
    background: transparent !important;
    padding-left: 12px !important;
    font-weight: 600 !important;
    width: 100% !important;
}


.sync-input-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-minimalist-download,
.input-minimalist,
.btn-minimalist-sync,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select {
    height: 52px !important;
    border-radius: 0px !important;
    box-sizing: border-box !important;
    font-size: 0.95rem !important;
    transition: all 0.2s !important;
}

.input-minimalist {
    border: 1px solid var(--border-light);
    padding: 0 15px;
    width: 100%;
}

.input-minimalist:focus,
input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

.btn-minimalist-download {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    width: 100%;
}

.btn-minimalist-sync {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 25px;
    font-weight: 700;
    cursor: pointer;
}

.btn-minimalist-sync:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 6. RESPONSIVE BEHAVIOR */
@media (max-width: 1100px) {
    .studio-layout {
        flex-direction: column;
        padding: 20px;
    }

    .studio-content-sidebar,
    .studio-workspace,
    .studio-preview {
        width: 100%;
        max-width: none;
    }

    .studio-content-sidebar {
        display: none;
        /* Hide sidebar on mobile/tablet as per request */
    }

    .studio-preview {
        border-radius: 0px;
        height: auto;
        min-height: 600px;
        order: 10;
        /* Force directly to bottom */
        border: none;
        box-shadow: none;
        background: transparent;
        position: relative;
        /* Remove sticky on mobile */
        top: auto;
    }

    #preview-screen {
        border: 8px solid #1e293b;
        height: 600px;
    }

    /* Stack inputs on mobile */
    .sync-input-stack {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .input-with-prefix,
    .btn-minimalist-sync {
        width: 100% !important;
    }

    .form-column-separator {
        border-left: none !important;
        border-top: 1px solid var(--border-light) !important;
        padding-top: 25px !important;
        margin-top: 25px !important;
    }

    .connect-form-grid {
        display: flex;
        flex-direction: column;
    }
}