:root {
    /* Color Palette */
    --color-primary: #919ede;
    --color-secondary: #ccf5ac;
    --color-bg-dark: #090d1f;
    --color-bg-card: rgba(9, 13, 31, 0.95);
    --color-text-primary: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-text-heading: #f1f5f9;
    --color-border: rgba(145, 158, 222, 0.15);
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Font */
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    --font-mono: 'Monaco', 'Consolas', 'Courier New', monospace;
}

/* === ANIMATIONS === */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}



@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}




@keyframes swapUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-10px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes swapDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(10px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === RESET & BASE STYLES === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-system);
    background: var(--color-bg-dark);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(145, 158, 222, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(204, 245, 172, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(145, 158, 222, 0.06) 0%, transparent 50%);
    min-height: 100vh;
    color: var(--color-text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* === HEADER STYLES === */
.header {
    background: var(--color-bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    flex-grow: 1;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-link {
    display: inline-block;
    text-decoration: none;
}

.logo {
    height: 40px;
    width: auto;
    opacity: 0.9;
    transition: opacity var(--transition-base);
}

.logo:hover {
    opacity: 1;
}

.brand-text h1,
.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-heading);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-text p,
.header p {
    color: var(--color-text-secondary);
    margin: 0;
}

.brand-text p {
    font-size: 0.9rem;
}

.header p {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
}

.header hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.3), rgba(167, 139, 250, 0.3));
    margin: 1.5rem 0;
    border-radius: 1px;
}

#workflow-title {
    font-size: 1.8rem;
    font-weight: 600;
}

.main-content {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem;
    overflow: hidden;
}

/* Override main-content for index page */
body.index-page .main-content {
    display: block;
    height: auto;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    position: relative;
    z-index: 5;
}

.workflow-panel {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(145, 158, 222, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.code-panel {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(145, 158, 222, 0.15);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none; /* Initially hidden */
    flex-direction: column;
}

.code-header {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #f1f5f9;
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(145, 158, 222, 0.15);
}

.code-content {
    flex: 1;
    overflow-y: auto;
    background: rgba(9, 13, 31, 0.6);
    border-radius: 0 0 12px 12px;
}

.code-content pre {
    margin: 0;
    padding: 1.5rem;
    background: transparent;
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    min-height: 100%;
}

#workflow-list {
    list-style: none;
}

#workflow-list li {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    transition: all 0.3s ease, transform 0.4s ease;
    color: #e2e8f0;
}

#workflow-list li::before {
    content: var(--step-number, counter(step-counter));
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    color: #090d1f;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(145, 158, 222, 0.3);
}

#workflow-list li:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(145, 158, 222, 0.3);
    transform: translateY(-1px);
}

#workflow-list li span.step-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

#workflow-list li span.step-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

#workflow-list li span.step-title {
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
}

#workflow-list li button {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.2);
    color: #e2e8f0;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

#workflow-list li button:hover {
    background: rgba(51, 65, 85, 1);
    border-color: rgba(145, 158, 222, 0.4);
    transform: translateY(-1px);
}

#workflow-list li button.move-up-btn:hover,
#workflow-list li button.move-down-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #93c5fd;
}

#workflow-list li button.edit-btn:hover {
    background: rgba(251, 146, 60, 0.2);
    border-color: #fb923c;
    color: #fdba74;
}

#workflow-list li button.duplicate-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
    color: #c4a2fd;
}

#workflow-list li button.remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
}

#workflow-list li button.add-below-btn:hover,
#workflow-list li button.add-nested-step-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #86efac;
}

/* Action slots styling */
.action-slots {
    margin-left: 2rem;
    margin-top: 1rem;
}

.action-slot {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.3);
    overflow: hidden;
}

.slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(145, 158, 222, 0.1);
    border-bottom: 1px solid rgba(145, 158, 222, 0.15);
}

.slot-label {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.add-slot-step-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    background: rgba(145, 158, 222, 0.2);
    border: 1px solid rgba(145, 158, 222, 0.3);
    color: #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-slot-step-btn:hover {
    background: rgba(145, 158, 222, 0.3);
    border-color: rgba(145, 158, 222, 0.5);
}

.slot-steps {
    list-style: none;
    padding: 1rem;
    margin: 0;
}

.slot-steps li {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(145, 158, 222, 0.15);
    margin-bottom: 0.75rem;
    position: relative;
}

.slot-steps li::before {
    content: var(--step-number, "1.1");
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    color: #090d1f;
    width: 35px;
    height: 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: 0 2px 10px rgba(145, 158, 222, 0.3);
}

/* Hide empty slot steps containers */
.slot-steps:empty {
    display: none;
}

dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 90vw;
    max-height: 90vh;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

dialog form {
    padding: 2rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

dialog p {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 1rem;
}

dialog hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, #919ede, #ccf5ac);
    margin-bottom: 1.5rem;
    border-radius: 1px;
}

dialog label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #cbd5e1;
}

dialog input,
dialog select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

dialog input:focus,
dialog select:focus {
    outline: none;
    border-color: #919ede;
    box-shadow: 0 0 0 3px rgba(145, 158, 222, 0.2);
}

dialog select[multiple] {
    min-height: 120px;
}

dialog small {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: block;
}

dialog button {
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    color: #090d1f;
    border: none;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem 0.5rem 0 0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

dialog button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(145, 158, 222, 0.4);
}

dialog button[type="button"] {
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(145, 158, 222, 0.2);
}

dialog button[type="button"]:hover {
    background: rgba(51, 65, 85, 1);
    border-color: rgba(145, 158, 222, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(51, 65, 85, 0.4);
}

#new-step-inputs, #edit-step-inputs {
    border: 2px dashed rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Variable badge/pill styles */
.variable-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    color: #090d1f;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 2px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
    animation: slideIn 0.2s ease-out;
}


.variable-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.variable-badge .remove-variable {
    margin-left: 4px;
    cursor: pointer;
    opacity: 0.7;
    font-weight: bold;
    transition: opacity 0.2s ease;
}

.variable-badge .remove-variable:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Enhanced input containers for variable support */
.variable-input-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.variable-input-field {
    position: relative;
    border-radius: 8px;
    padding: 8px;
    min-height: 40px;
    cursor: text;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 2px solid rgba(145, 158, 222, 0.2) !important;
    color: #f1f5f9 !important;
    backdrop-filter: blur(10px);
}

/* Textarea-style variable fields */
.variable-input-field[data-is-textarea="true"] {
    min-height: 80px;
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
    height: auto;
    resize: vertical;
    overflow-y: auto;
    display: block; /* Override flex layout for proper line stacking */
    flex-wrap: initial; /* Reset flex-wrap */
    gap: initial; /* Reset gap */
}

.variable-input-field[data-is-textarea="true"] .text-line {
    display: block;
    min-height: 1.2em;
    line-height: 1.2;
    width: 100%;
    margin-bottom: 4px;
}

.variable-input-field[data-is-textarea="true"] .text-segment {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.2;
    display: inline;
}

.variable-input-field:hover {
    border-color: #cbd5e0;
}

.variable-input-field:focus-within {
    border-color: #919ede;
    box-shadow: 0 0 0 3px rgba(145, 158, 222, 0.1);
}

.variable-input-field.has-variables {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

/* Text segments for inline editing */
.variable-input-field .text-segment {
    display: inline-block;
    min-width: 2px;
    min-height: 1em;
    outline: none;
    white-space: pre;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
}

.variable-input-field .text-segment.empty-segment {
    position: relative;
}

/* Placeholder text for empty variable fields */
.variable-input-field .placeholder-text {
    position: absolute;
    top: 8px;
    left: 8px;
    margin-left: 8px;
    color: #64748b;
    opacity: 1;
    pointer-events: none;
    user-select: none;
    z-index: 10;
    font-size: inherit;
    font-family: Arial, sans-serif;
    line-height: inherit;
    white-space: pre-wrap;
}

/* Variable picker dropdown */
.variable-picker {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: dropdownSlide 0.2s ease-out;
}


.variable-picker-header {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    position: sticky;
    top: 0;
}

.variable-picker-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.variable-picker-item:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-left: 3px solid #919ede;
    padding-left: 9px;
}

.variable-picker-item:last-child {
    border-bottom: none;
}

.variable-picker-item .variable-name {
    font-weight: 500;
    color: #333;
}

.variable-picker-item .variable-type {
    font-size: 0.8rem;
    color: #666;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.variable-picker-item:hover .variable-type {
    background: #919ede;
    color: white;
}

.variable-picker-item .variable-source {
    font-size: 0.8rem;
    color: #999;
}

/* Add variable button */
.add-variable-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.2);
}

.add-variable-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.add-variable-btn:active {
    transform: translateY(0);
}

/* Loading state for variable picker */
.variable-picker-loading {
    padding: 12px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.variable-picker-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #ddd;
    border-top: 2px solid #919ede;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


/* Object input field styles */
.object-input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.object-input-fields {
    border: 2px dashed rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 1rem;
}

/* Array input fields - same styling as object input fields */
.array-input-fields {
    border: 2px dashed rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 1rem;
}

.object-field-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

/* Array field row - same styling as object field row */
.array-field-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Object field row structure */
.object-field-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Top row: Key input and Type dropdown */
.object-field-top-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

/* Bottom row: Value input and Remove button */
.object-field-bottom-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

/* Array field inputs - same styling as object field inputs */
.array-field-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Object field key input */
.object-field-key-input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

/* Object field type select */
.object-field-type-select {
    width: 100%;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}


/* Object field value inputs */
.object-field-value-input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

/* Array field inputs - same styling as object field inputs */
.array-field-inputs input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

/* Focus styles for object field inputs */
.object-field-key-input:focus,
.object-field-type-select:focus,
.object-field-value-input:focus {
    outline: none;
    border-color: #919ede;
    box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.2);
}

.array-field-inputs input:focus {
    outline: none;
    border-color: #919ede;
    box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.2);
}

/* Placeholder styles for object field inputs */
.object-field-key-input::placeholder,
.object-field-value-input::placeholder {
    color: #64748b;
}

.array-field-inputs input::placeholder {
    color: #64748b;
}

/* Object field remove button */
.object-field-remove-btn {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-top: 0.25rem;
}

.object-field-remove-btn:hover {
    background: rgba(220, 38, 38, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* Add field button */
.add-field-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.add-field-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.add-field-btn:active {
    transform: translateY(0);
}

/* Array input container - add gap between fields and button */
.array-input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Unified input wrapper styles */
.unified-input-container {
    margin-bottom: 1rem;
}

.input-label-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.input-label-wrapper label {
    font-weight: 600;
    font-size: 0.9rem;
}

.input-mode-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(145, 158, 222, 0.2);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-mode-toggle span {
    padding: 2px 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.input-mode-toggle span:hover {
    opacity: 0.8;
}

.value-mode-field,
.reference-mode-field {
    width: 100%;
}

.reference-input-field {
    width: 100%;
}

.reference-display {
    width: 100%;
    cursor: pointer;
    background-color: rgba(145, 158, 222, 0.05);
}

.reference-display:hover {
    background-color: rgba(145, 158, 222, 0.1);
}

.variable-dropdown {
    display: none;
    position: absolute;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    margin-top: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.variable-option {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
}

.variable-option:hover {
    background: #2a2a2a;
}

.variable-option:last-child {
    border-bottom: none;
}

/* Single Variable Selector Styles */
.single-variable-selector {
    position: relative;
    width: 100%;
}

.variable-selector-display {
    padding: 0.5rem 0.75rem;
    background: rgba(145, 158, 222, 0.05);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 6px;
    cursor: pointer;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.variable-selector-display:hover {
    background: rgba(145, 158, 222, 0.08);
    border-color: rgba(145, 158, 222, 0.4);
}

.variable-text {
    color: #919ede;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
}

.variable-text.empty {
    color: #666;
    font-family: inherit;
}

.variable-selector-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.variable-selector-option {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(145, 158, 222, 0.05);
    transition: background 0.2s;
}

.variable-selector-option:hover {
    background: rgba(145, 158, 222, 0.08);
}

.variable-selector-option:last-child {
    border-bottom: none;
}

.variable-selector-option.clear-option {
    color: #666;
    font-style: italic;
    border-bottom: 1px solid rgba(145, 158, 222, 0.1);
}

.variable-selector-option.clear-option:hover {
    background: rgba(145, 158, 222, 0.1);
}

/* Input mode toggle styles */
.input-mode-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.mode-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #919ede;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-toggle-btn {
    background: rgba(145, 158, 222, 0.1);
    color: #919ede;
    border: 1px solid rgba(145, 158, 222, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-toggle-btn:hover {
    background: rgba(145, 158, 222, 0.2);
    border-color: rgba(145, 158, 222, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(145, 158, 222, 0.2);
}

.mode-toggle-btn:active {
    transform: translateY(0);
}

/* Reference input styles */
.array-reference-input,
.object-reference-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.array-reference-input:focus,
.object-reference-input:focus {
    outline: none;
    border-color: #919ede;
    box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.2);
}

.array-reference-input::placeholder,
.object-reference-input::placeholder {
    color: #64748b;
    font-style: italic;
}

.header-content {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 10;
    gap: 1rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #e2e8f0;
}

#user-name {
    font-weight: 500;
    color: #f1f5f9;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.2);
    margin-bottom: 3rem;
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #f1f5f9;
}

/* === BUTTON STYLES === */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    background-size: 150% 150%;
    background-position: 0% 50%;
    color: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    font-weight: 600;
    transition: all var(--transition-slow);
}

.btn-primary:hover:not(:disabled) {
    background-position: 50% 50%;
    box-shadow: 0 4px 12px rgba(145, 158, 222, 0.4);
}

.btn-secondary {
    background: rgba(51, 65, 85, 0.8);
    color: var(--color-text-primary);
    border: 1px solid rgba(51, 65, 85, 0.5);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(51, 65, 85, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success), #059669);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(145, 158, 222, 0.1);
    border-color: var(--color-primary);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.btn-outline-danger:hover:not(:disabled) {
    background: var(--color-danger);
    color: white;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.app-card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(51, 65, 85, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 12px;
    pointer-events: none;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(96, 165, 250, 0.4);
}

.app-header {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.app-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.app-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.app-status.active, .domain-status-badge.active {
    background: linear-gradient(135deg, #84cc16, #65a30d);
    box-shadow: 0 2px 8px rgba(132, 204, 22, 0.3);
}

.app-status.inactive, .domain-status-badge.inactive {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.app-status.error, .domain-status-badge.error {
    background: linear-gradient(135deg,
            #ef4444,
            #dc2626);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.app-status.starting, .domain-status-badge.starting {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.app-details {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.3);
}

/* --- App Details Page Tabs --- */
/* Dashboard Container Layout */
body .dashboard-container,
#main-content.dashboard-container {
    display: flex;
    flex-direction: row;
    gap: 0;
    min-height: calc(100vh - 84px);
    padding: 0;
    margin: 0;
    max-width: 100%;
    width: 100%;
    align-items: stretch;
    position: relative;
}

.sidebar-tabs {
    background: rgba(15, 23, 42, 0.6);
    width: 240px;
    min-width: 240px;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-right: 1px solid rgba(145, 158, 222, 0.1);
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    height: calc(100vh - 84px);
    overflow-y: auto;
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: rgba(10, 15, 30, 0.3);
    min-width: 0;
}

/* Vertical sidebar tab buttons */
.sidebar-tabs .tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    border-left: 3px solid transparent;
    justify-content: flex-start;
    outline: none;
}

.sidebar-tabs .tab-btn .tab-icon {
    font-size: 1.2rem;
    width: 24px;
    display: inline-flex;
    justify-content: center;
}

.sidebar-tabs .tab-btn .tab-label {
    flex: 1;
}

/* Sidebar spacer to push launch button to bottom */
.sidebar-spacer {
    flex: 1;
    min-height: 2rem;
}

/* Sidebar footer buttons */
.sidebar-back-btn,
.sidebar-launch-btn {
    margin: 0 1rem 0.5rem 1rem;
    width: calc(100% - 2rem);
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.sidebar-back-btn {
    margin-bottom: 0.75rem;
}

.sidebar-launch-btn {
    margin-bottom: 1rem;
}

/* Split Button Styles */
.split-button-group {
    position: relative;
    display: flex;
    margin: 0 1rem 1rem 1rem;
    width: calc(100% - 2rem);
}

.split-button-main {
    flex: 1;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0;
    width: auto;
}

.split-button-dropdown {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: none;
    padding: 1rem 0.75rem;
    margin: 0;
    width: auto;
    min-width: auto;
    flex-shrink: 0;
}

/* Launch Dropdown */
.launch-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
}

.launch-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.launch-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    text-decoration: none;
    border-bottom: 1px solid rgba(145, 158, 222, 0.1);
    transition: background-color 0.2s ease;
}

.launch-dropdown-item:last-child {
    border-bottom: none;
}

.launch-dropdown-item:hover {
    background: rgba(145, 158, 222, 0.1);
    color: #ffffff;
}

/* Sidebar tab hover state */
.sidebar-tabs .tab-btn:hover {
    background: rgba(145, 158, 222, 0.1);
    color: #e2e8f0;
    border-left-color: rgba(145, 158, 222, 0.3);
}

/* Sidebar tab focus state (keyboard accessibility) */
.sidebar-tabs .tab-btn:focus-visible {
    background: rgba(145, 158, 222, 0.15);
    color: #e2e8f0;
    border-left-color: #919ede;
    outline: 2px solid #919ede;
    outline-offset: -2px;
    box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.3);
}

/* Sidebar tab active state */
.sidebar-tabs .tab-btn.active {
    background: rgba(30, 41, 59, 0.8);
    color: #919ede;
    border-left-color: #919ede;
}

/* Tab section styles (inline expandable) */
.tab-section {
    width: 100%;
}

.section-toggle {
    position: relative;
}

.section-arrow {
    font-size: 0.7rem;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.tab-section.expanded .section-arrow {
    transform: rotate(180deg);
}

.tab-subsection {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(10, 15, 30, 0.5);
}

.tab-section.expanded .tab-subsection {
    max-height: 200px; /* Adjust based on content */
}

.subsection-item {
    width: 100%;
    padding: 0.75rem 1.5rem 0.75rem 3rem; /* Extra left padding for nesting */
    border: none;
    background: transparent;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.subsection-item:hover {
    background: rgba(145, 158, 222, 0.1);
    color: #e2e8f0;
    border-left-color: rgba(145, 158, 222, 0.3);
}

.subsection-item:focus-visible {
    background: rgba(145, 158, 222, 0.15);
    color: #e2e8f0;
    border-left-color: #919ede;
    outline: 2px solid #919ede;
    outline-offset: -2px;
    box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.3);
}


.subsection-item.active {
    background: rgba(30, 41, 59, 0.8);
    color: #919ede;
    border-left-color: #919ede;
}

/* Content area tab content */
.content-area .tab-content {
    background: transparent;
    padding: 0;
    animation: fadeIn 0.3s ease-in-out;
    max-width: 1200px;
}


.tab-content h2 {
    color: #f1f5f9;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tab-content h3 {
    margin-bottom: 0.5rem;
}

#logic-list ul {
    list-style: disc inside;
    margin: 1rem 0 0 1rem;
    color: #e2e8f0;
}
#logic-list li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Mobile Menu Toggle - Base Styles */
.mobile-menu-toggle {
    display: none;
    position: relative;
    z-index: 99;
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid rgba(145, 158, 222, 0.5);
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    box-shadow: var(--shadow-sm);
    margin-left: auto;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle:hover {
    background: rgba(30, 41, 59, 1);
    border-color: rgba(145, 158, 222, 0.7);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 89;
}

.mobile-menu-overlay.active {
    display: block;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #94a3b8;
}

.detail-value {
    font-weight: 600;
    color: #e2e8f0;
}

.app-actions {
    padding: 1rem 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(51, 65, 85, 0.3);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.app-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Split button in app cards */
.app-actions .split-button-group {
    flex: 1;
    margin: 0;
    width: auto;
}

.app-actions .split-button-main {
    margin: 0;
}

.app-actions .split-button-dropdown {
    margin: 0;
    flex-shrink: 0;
    flex: none;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(51, 65, 85, 0.3);
    backdrop-filter: blur(10px);
}

.empty-icon {
    font-size: 4rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e2e8f0;
}

.empty-description {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

/* === LOGIN PAGE STYLES === */
body.login-page {
    background: #090d1f;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(145, 158, 222, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(204, 245, 172, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(145, 158, 222, 0.06) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container {
    background: rgba(9, 13, 31, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(145, 158, 222, 0.15);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    margin: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    height: 48px;
    width: auto;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: #94a3b8;
    font-size: 1rem;
}

.auth-tabs {
    display: flex;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 8px;
    margin-bottom: 2rem;
    padding: 4px;
    border: 1px solid rgba(145, 158, 222, 0.1);
}

.auth-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    border: none;
    color: #94a3b8;
}

.auth-tab.active {
    background: rgba(145, 158, 222, 0.2);
    color: #f1f5f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    border: 1px solid rgba(145, 158, 222, 0.3);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #f1f5f9;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
}

/* Login page specific form inputs */
body.login-page .form-group input {
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 2px solid rgba(145, 158, 222, 0.2);
    color: #e2e8f0;
}

body.login-page .form-group input::placeholder {
    color: #64748b;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #919ede;
    box-shadow: 0 0 0 3px rgba(145, 158, 222, 0.1);
    background: rgba(15, 23, 42, 0.8);
}

/* Only show validation styling after user interaction */
.form-group input.touched:invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-group select.touched:invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-help {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.password-toggle {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.2rem;
    padding: 4px;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #e2e8f0;
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    color: #919ede;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #94a3b8;
    font-size: 0.9rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(145, 158, 222, 0.2);
    z-index: 1;
}

.divider span {
    background: rgba(9, 13, 31, 0.95);
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* === CREATE APP PAGE STYLES === */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
}


.back-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.wizard-container {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(145, 158, 222, 0.15);
    overflow: hidden;
    position: relative;
}

.wizard-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 12px;
    pointer-events: none;
}

.progress-bar {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(145, 158, 222, 0.15);
    position: relative;
    z-index: 1;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 1rem;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: rgba(145, 158, 222, 0.2);
    z-index: 1;
    transform: translateY(-50%);
}

.progress-line-wrapper {
    position: absolute;
    z-index: 2;
    top: 20px;
    left: 20px;
    right: 20px;
}

.progress-line {
    height: 2px;
    background: linear-gradient(135deg, #919ede 0%, #ccf5ac 100%);
    transform: translateY(-50%);
    transition: width 0.3s ease;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(51, 65, 85, 0.6);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(145, 158, 222, 0.2);
}

.step.active .step-circle {
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    color: #090d1f;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(145, 158, 222, 0.4);
}

.step.completed .step-circle {
    background: linear-gradient(135deg, #84cc16, #65a30d);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    color: #94a3b8;
    text-align: center;
    font-weight: 500;
}

.step.active .step-label {
    color: #f1f5f9;
    font-weight: 600;
}

.wizard-content {
    padding: 2rem;
    background: rgba(15, 23, 42, 0.3);
    position: relative;
    z-index: 1;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f1f5f9;
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-description {
    color: #94a3b8;
    margin-bottom: 2rem;
}

.bundle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.bundle-option {
    border: 2px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.bundle-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 8px;
    pointer-events: none;
}

.bundle-option:hover {
    border-color: #919ede;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(145, 158, 222, 0.3);
}

.bundle-option.selected {
    border-color: #919ede;
    background: rgba(145, 158, 222, 0.1);
    box-shadow: 0 4px 12px rgba(145, 158, 222, 0.4);
}

.bundle-option input[type='radio'] {
    position: absolute;
    visibility: hidden;
}

.bundle-name {
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.bundle-specs {
    color: #94a3b8;
    font-size: 0.9rem;
}

.bundle-price {
    color: #919ede;
    font-weight: 600;
    margin-top: 0.5rem;
}

.summary-section {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(145, 158, 222, 0.15);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.summary-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 8px;
    pointer-events: none;
}

.summary-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(145, 158, 222, 0.15);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #94a3b8;
    font-weight: 500;
}

.summary-value {
    color: #f1f5f9;
    font-weight: 600;
}

.wizard-actions {
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(145, 158, 222, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    gap: 1rem;
}

.success-state {
    text-align: center;
    padding: 3rem;
    position: relative;
    z-index: 1;
}

.success-icon {
    font-size: 4rem;
    color: #84cc16;
    margin-bottom: 1rem;
}

.success-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.success-description {
    color: #94a3b8;
    margin-bottom: 2rem;
}

body.create-app-page .header {
    padding: 1.5rem 0;
}

/* Create app page header styling */
body.create-app-page .header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0;
}

/* Index page header styling */
body.index-page .header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

body.index-page .header p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: white;
    margin-bottom: 0;
}

/* Index page button styling */
body.index-page .user-menu .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

body.index-page .user-menu .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Workflow page keeps its existing header styling from the original CSS */

/* Full-width buttons for login page */
body.login-page .btn {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 1rem;
    justify-content: center;
}

/* Wizard actions for create app page */
body.create-app-page .wizard-actions .btn {
    min-width: 120px;
    justify-content: center;
}

/* === WORKFLOW PAGE SPECIFIC STYLES === */
/* Override header for workflow page only */
body.workflow-page .header {
    background: rgba(9, 13, 31, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(145, 158, 222, 0.15);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    color: #e2e8f0;
}

body.workflow-page .header h1 {
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.workflow-page .header p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

body.workflow-page .header h2 {
    color: #f1f5f9;
    margin: 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

body.workflow-page .header hr {
    border: none;
    height: 1px;
    background: rgba(145, 158, 222, 0.2);
    margin: 1rem 0;
}

/* Workflow panel styling */
body.workflow-page .workflow-panel {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(145, 158, 222, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

/* Code panel styling */
body.workflow-page .code-panel {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(145, 158, 222, 0.15);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

body.workflow-page .code-header {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #f1f5f9;
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(145, 158, 222, 0.15);
}

body.workflow-page .code-content {
    flex: 1;
    overflow-y: auto;
    background: rgba(9, 13, 31, 0.6);
    border-radius: 0 0 12px 12px;
}

body.workflow-page .code-content pre {
    margin: 0;
    padding: 1.5rem;
    background: transparent;
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    min-height: auto;
}

/* Workflow list styling */
body.workflow-page #workflow-list {
    list-style: none;
    counter-reset: step-counter;
}

body.workflow-page #workflow-list li {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    padding:  1rem 1rem 1rem 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    transition: all 0.3s ease, transform 0.4s ease;
    color: #e2e8f0;
}

body.workflow-page #workflow-list li:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(145, 158, 222, 0.3);
    transform: translateY(-1px);
}

body.workflow-page #workflow-list li button {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.2);
    color: #e2e8f0;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

body.workflow-page #workflow-list li button:hover {
    background: rgba(51, 65, 85, 1);
    border-color: rgba(145, 158, 222, 0.4);
    transform: translateY(-1px);
}

/* Dialog styling for workflow page */
body.workflow-page dialog {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 12px;
    color: #e2e8f0;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.workflow-page dialog form {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

body.workflow-page dialog p {
    color: #f1f5f9;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

body.workflow-page dialog hr {
    border: none;
    height: 1px;
    background: rgba(145, 158, 222, 0.2);
    margin-bottom: 1.5rem;
}

body.workflow-page dialog label {
    color: #cbd5e1;
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

body.workflow-page dialog input,
body.workflow-page dialog select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

body.workflow-page dialog input:focus,
body.workflow-page dialog select:focus {
    outline: none;
    border-color: #919ede;
    box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.2);
}

body.workflow-page dialog button {
    background: linear-gradient(135deg, #919ede, #ccf5ac);
    border: none;
    color: #0f172a;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.5rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

body.workflow-page dialog button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(145, 158, 222, 0.4);
}

body.workflow-page dialog button[type="button"] {
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(145, 158, 222, 0.2);
}

body.workflow-page dialog button[type="button"]:hover {
    background: rgba(51, 65, 85, 1);
    border-color: rgba(145, 158, 222, 0.4);
}

/* Create app page specific form styling */
body.create-app-page .form-group label {
    color: #f1f5f9;
    font-weight: 600;
}

body.create-app-page .form-group input,
body.create-app-page .form-group select,
body.create-app-page .form-group textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(145, 158, 222, 0.2);
    color: #f1f5f9;
    backdrop-filter: blur(10px);
}

body.create-app-page .form-group input::placeholder,
body.create-app-page .form-group select::placeholder,
body.create-app-page .form-group textarea::placeholder {
    color: #94a3b8;
}

body.create-app-page .form-group input:focus,
body.create-app-page .form-group select:focus,
body.create-app-page .form-group textarea:focus {
    border-color: #919ede;
    box-shadow: 0 0 0 3px rgba(145, 158, 222, 0.2);
}

body.create-app-page .form-help {
    color: #94a3b8;
}

body.create-app-page .form-group input.touched:invalid {
    border-color: #ef4444;
}

body.create-app-page .form-group select.touched:invalid {
    border-color: #ef4444;
}

/* Dark input styling for app-details page */
.dark-input {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 2px solid rgba(145, 158, 222, 0.2) !important;
    color: #f1f5f9 !important;
    backdrop-filter: blur(10px);
}

.dark-input::placeholder {
    color: #94a3b8 !important;
}

.dark-input:focus {
    border-color: #919ede !important;
    box-shadow: 0 0 0 3px rgba(145, 158, 222, 0.2) !important;
    outline: none !important;
}

.dark-input.touched:invalid {
    border-color: #ef4444 !important;
}

/* Validation error styling */
.validation-error {
    border-color: #ef4444 !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    animation: shake 0.5s ease-in-out;
}


/* Code input styling */
.code-input-container {
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 1rem !important;
    display: block !important;
}

.code-input-textarea {
    width: 100% !important;
    min-height: 120px !important;
    max-height: 300px !important;
    padding: 12px !important;
    background: rgba(15, 23, 42, 0.6) !important;
    color: #f1f5f9 !important;
    border: 2px solid rgba(145, 158, 222, 0.2) !important;
    border-radius: 8px !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    resize: vertical !important;
    outline: none !important;
    box-sizing: border-box !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
}

.code-input-textarea:focus {
    border-color: #919ede !important;
    box-shadow: 0 0 0 3px rgba(145, 158, 222, 0.2) !important;
    outline: none !important;
}

/* CodeMirror focused state */
.CodeMirror-focused {
    border-color: #919ede !important;
    box-shadow: 0 0 0 3px rgba(145, 158, 222, 0.2) !important;
    outline: none !important;
}

/* CodeMirror styling */
/* Main CodeMirror container */
.CodeMirror {
    background: rgba(15, 23, 42, 0.6) !important;
    color: #f1f5f9 !important;
    border: 2px solid rgba(145, 158, 222, 0.2) !important;
    border-radius: 8px !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    height: 100% !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

/* CodeMirror lines container */
.CodeMirror-lines, .codeMirror-gutters {
    padding: 8px 0 !important;
}

/* Individual CodeMirror line */
.CodeMirror-line {
    padding: 0 8px !important;
}

/* CodeMirror gutters (line numbers area) */
.CodeMirror-gutters {
    background: rgba(30, 41, 59, 0.8) !important;
    border-right: 1px solid rgba(145, 158, 222, 0.3) !important;
    width: 40px !important;
}

/* CodeMirror line numbers */
.CodeMirror-linenumber {
    color: #64748b !important;
    padding: 0 8px 0 4px !important;
    min-width: 20px !important;
    text-align: right !important;
    font-size: 13px !important;
    line-height: 1.6rem;
}

/* CodeMirror cursor */
.CodeMirror-cursor {
    border-left: 1px solid #f1f5f9 !important;
}

/* CodeMirror selected text */
.CodeMirror-selected {
    background: rgba(71, 85, 105, 0.6) !important;
}

/* CodeMirror active line */
.CodeMirror-activeline-background {
    background: rgba(51, 65, 85, 0.6) !important;
}

/* CodeMirror filler line */
.CodeMirror-filler {
    background: transparent !important;
}

/* CodeMirror syntax highlighting */
.cm-keyword {
    color: #ff79c6 !important;
    font-weight: bold !important;
}
.cm-string, .cm-string-2 {
    color: #f1fa8c !important;
}
.cm-number {
    color: #bd93f9 !important;
}
.cm-def, .cm-variable-2 {
    color: #50fa7b !important;
}
.cm-comment {
    color: #6272a4 !important;
    font-style: italic !important;
}
.cm-operator {
    color: #ff79c6 !important;
}
.cm-atom {
    color: #bd93f9 !important;
}
.cm-property {
    color: #8be9fd !important;
}

/* Textarea styling for code input */
.code-input-container textarea.code-input-textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    background: rgba(15, 23, 42, 0.6) !important;
    color: #f1f5f9 !important;
    border: 2px solid rgba(145, 158, 222, 0.2) !important;
    border-radius: 8px !important;
    padding: 12px 12px 12px 45px !important; /* Add left padding for line numbers */
    min-height: 120px !important;
    max-height: 300px !important;
    resize: vertical !important;
    width: 100% !important;
    tab-size: 2 !important;
    white-space: pre !important;
    overflow-wrap: normal !important;
    overflow-x: auto !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
    background-image: linear-gradient(to right, rgba(51, 65, 85, 0.8) 40px, rgba(71, 85, 105, 0.3) 40px) !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
    background-attachment: local !important;
}




.code-editor-wrapper {
    position: relative;
    border: 2px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #f1f5f9;
    background: transparent;
    border: none;
    outline: none;
    padding: 12px;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre;
    overflow-wrap: normal;
    tab-size: 2;
    position: relative;
    z-index: 2;
    resize: none;
}

.code-editor:empty:before {
    content: attr(data-placeholder);
    color: #64748b;
    pointer-events: none;
}

.code-highlight-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    padding: 12px;
    margin: 0 !important;
    background: transparent !important;
    color: transparent;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    white-space: pre;
    tab-size: 2;
}

.code-highlight-layer code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    background: transparent !important;
}

.code-input {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    tab-size: 2;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.code-preview-container {
    border: 2px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    max-height: 300px;
    overflow: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-preview-container pre {
    margin: 0 !important;
    padding: 12px !important;
    background: transparent !important;
}

.code-preview-container code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.code-preview-toggle {
    background: #334155;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.code-preview-toggle:hover {
    background: #475569;
}

/* Code preview styling - No CodeMirror */
.code-preview {
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
    border: 2px solid rgba(145, 158, 222, 0.2);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    padding: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* App details page form styling */
body.app-details-page .form-group label {
    color: #f1f5f9;
    font-weight: 600;
}

body.app-details-page .form-help {
    color: #94a3b8;
}

.logic-header {
    margin-bottom: 2rem;
}

.logic-header p {
    margin-bottom: 1.5rem;
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.6;
}

#logic-container {
    margin-top: 1rem;
}

/* Logic Group Styles */
.logic-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.logic-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logic-group-info {
    flex: 1;
}

.logic-group-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 0.5rem 0;
}

.logic-group-meta {
    font-size: 0.875rem;
    color: #94a3b8;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    display: inline-block;
}

.logic-group-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.logic-workflows {
    display: grid;
    gap: 1rem;
}

/* Empty group state */
.logic-empty-group {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.empty-group-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.empty-group-text {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Individual workflow card styles */
.logic-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.logic-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.logic-info {
    margin-bottom: 1rem;
}

.logic-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.logic-trigger {
    font-size: 0.875rem;
    color: #94a3b8;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.logic-description {
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.logic-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.logic-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Logic card responsive design moved to media queries section */

/* Logic groups responsive design moved to media queries section */

#logic-list ul {
    list-style: disc inside;
    margin: 1rem 0 0 1rem;
    color: #e2e8f0;
}
#logic-list li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Mobile Menu Toggle - Base Styles */
.mobile-menu-toggle {
    display: none;
    position: relative;
    z-index: 99;
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid rgba(145, 158, 222, 0.5);
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    box-shadow: var(--shadow-sm);
    margin-left: auto;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle:hover {
    background: rgba(30, 41, 59, 1);
    border-color: rgba(145, 158, 222, 0.7);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 89;
}

.mobile-menu-overlay.active {
    display: block;
}
/* Mobile responsive styles moved to consolidated media queries section at end of file */

/* Additional premium styling */
.dashboard-header {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.2);
    margin-bottom: 3rem;
}

.dashboard-header .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Glassmorphism effect for cards */
.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 12px;
    pointer-events: none;
}

.app-card {
    position: relative;
}

/* Improve button focus states */
.btn:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.5);
    outline-offset: 2px;
}

/* Loading animation improvements */

.loading-shimmer {
    background: linear-gradient(90deg, rgba(51, 65, 85, 0.1) 0px, rgba(96, 165, 250, 0.2) 40px, rgba(51, 65, 85, 0.1) 80px);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* === APP DETAILS PAGE SPECIFIC STYLES === */
body.app-details-page .main-content {
    display: block;
    height: auto;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
    width: calc(100% - 2rem);
    position: relative;
    z-index: 5;
}

/* App Overview Section */
/* App overview section in General tab */
.app-overview-section {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(51, 65, 85, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
    position: relative;
}

/* Settings section in General tab */
.settings-section {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid rgba(145, 158, 222, 0.15);
}

.settings-section h3 {
    color: #f1f5f9;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Danger Zone Styles */
.danger-zone {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.danger-zone h4 {
    color: #ef4444;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.danger-zone-text {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.btn-outline-danger {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    transform: translateY(-1px);
}


.domain-card, .plan-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(145, 158, 222, 0.15);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    position: relative;
}

.domain-card::before, .plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 8px;
    pointer-events: none;
}

.domain-card:last-child, .plan-card:last-child {
    margin-bottom: 0;
}

.domain-info, .plan-info {
    position: relative;
    z-index: 1;
}

.domain-url {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.domain-type {
    color: #94a3b8;
    font-size:  0.9rem;
}

.domain-actions, .plan-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.domain-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.domain-status-badge.inactive {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.dns-instructions {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.dns-instructions h4 {
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.dns-instructions p {
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

.dns-instructions code {
    background: rgba(15, 23, 42, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #96c3f7;
}

/* CNAME Instructions Styles */
.cname-instructions {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    font-size: 0.875rem;
}

.cname-title {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cname-message {
    color: #cbd5e1;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cname-record {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(145, 158, 222, 0.2);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.cname-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cname-row:last-child {
    margin-bottom: 0;
}

.cname-label {
    color: #94a3b8;
    font-weight: 500;
    min-width: 80px;
}

.cname-value-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
}

.cname-value {
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    background: rgba(9, 13, 31, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    flex: 1;
}

/* Copy Button Styles */
.copy-btn {
    min-width: 32px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0;
    font-family: inherit;
}

.copy-btn:hover {
    background: rgba(30, 41, 59, 1);
    border-color: rgba(145, 158, 222, 0.5);
    color: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.copy-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.4);
}

.copy-btn.success {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

.copy-btn.success:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.6);
}

.cname-note {
    color: #fbbf24;
    font-size: 0.8rem;
    font-style: italic;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    isolation: isolate;
}

.toast {
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 500;
    width: 350px;
    max-width: 400px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast span {
    flex: 1;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #e2e8f0;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(145, 158, 222, 0.4);
    border-radius: 0 0 8px 8px;
    transition: width linear;
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.25);
}

.toast.success::before {
    content: '✓';
    color: #22c55e;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast.success .toast-progress {
    background: rgba(34, 197, 94, 0.6);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.25);
}

.toast.error::before {
    content: '✕';
    color: #ef4444;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast.error .toast-progress {
    background: rgba(239, 68, 68, 0.6);
}

.toast.warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.25);
}

.toast.warning::before {
    content: '⚠';
    color: #f59e0b;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast.warning .toast-progress {
    background: rgba(245, 158, 11, 0.6);
}

.toast.info {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.25);
}

.toast.info::before {
    content: 'ℹ';
    color: #3b82f6;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast.info .toast-progress {
    background: rgba(59, 130, 246, 0.6);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid rgba(145, 158, 222, 0.2);
}

.modal-header h2 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin: 0 0 20px 0;
    color: #cbd5e1;
    line-height: 1.6;
}

.credentials-info {
    margin: 20px 0;
}

.credential-item {
    margin-bottom: 16px;
}

.credential-item:last-child {
    margin-bottom: 0;
}

.credential-item label {
    display: block;
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.credential-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.credential-value {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(145, 158, 222, 0.2);
    border-radius: 6px;
    padding: 10px 12px;
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    flex: 1;
    word-break: break-all;
}

.modal-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    color: #fbbf24;
    font-size: 0.875rem;
    line-height: 1.5;
}

.modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(145, 158, 222, 0.2);
    gap: 0.5rem;
}

/* Logic Group Specific Styles */
/* Remove bottom margin from the last logic group */
.logic-group:last-child {
    margin-bottom: 0;
}

/* Logic info desktop styles moved to media queries section */

.hljs {
    background: transparent;
}

.header button:not(:first-child) {
    margin-left: 0.5rem;
}

/* Code panel toggle states */
.code-panel.visible {
    display: flex !important;
}

.main-content .code-panel {
    display: none !important;
}

.main-content.code-hidden .workflow-panel {
    flex: 1;
    max-width: 100%;
}

.main-content.code-visible .workflow-panel {
    flex: 1;
    max-width: calc(50% - 0.5rem);
}

.main-content.code-visible .code-panel {
    display: flex !important;
    flex: 1;
    max-width: calc(50% - 0.5rem);
}

/* Mobile code modal styles */
.modal-code-content {
    max-width: 95vw;
    max-height: 90vh;
    width: 100%;
}

.modal-code-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.modal-code-body .code-content {
    height: 60vh;
    border-radius: 8px;
    margin: 1rem;
    border: 1px solid rgba(145, 158, 222, 0.15);
}

/* Mobile responsive behavior moved to media queries section */

/* Button outline style */
.btn-outline {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(145, 158, 222, 0.3);
}

.btn-outline:hover {
    background: rgba(145, 158, 222, 0.1);
    border-color: rgba(145, 158, 222, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(145, 158, 222, 0.2);
}

/* Step animation classes */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
        margin-bottom: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        margin-bottom: 0.75rem;
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
        margin-bottom: 0.75rem;
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
        margin-bottom: 0;
    }
}

@keyframes swapUp {
    0% {
        transform: translateY(0);
        z-index: 1;
    }
    50% {
        transform: translateY(-120%);
        z-index: 10;
    }
    100% {
        transform: translateY(0);
        z-index: 1;
    }
}

@keyframes swapDown {
    0% {
        transform: translateY(0);
        z-index: 1;
    }
    50% {
        transform: translateY(120%);
        z-index: 10;
    }
    100% {
        transform: translateY(0);
        z-index: 1;
    }
}

.step-slide-in {
    animation: slideInDown 0.4s ease forwards;
}

.step-slide-out {
    animation: slideOutUp 0.4s ease forwards;
}

.step-swap-up {
    animation: swapUp 0.1s ease;
}

.step-swap-down {
    animation: swapDown 0.1s ease;
}

#workflow-list li.animating {
    pointer-events: none;
}

/* Empty state styling for workflow lists */
.workflow-list-empty {
    border: 2px dashed rgba(145, 158, 222, 0.3);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    color: rgba(226, 232, 240, 0.6);
    font-size: 0.9rem;
    margin: 0;
    background: rgba(30, 41, 59, 0.2);
    transition: all 0.3s ease;
    display: none; /* Hidden by default */
}

.workflow-list-empty:hover {
    border-color: rgba(145, 158, 222, 0.5);
    background: rgba(30, 41, 59, 0.3);
}

.workflow-list-empty .empty-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.workflow-list-empty .empty-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(226, 232, 240, 0.8);
}

.workflow-list-empty .empty-description {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Nested empty state - smaller and more subtle */
.workflow-list-empty[data-for="nested"] {
    padding: 2rem 1.5rem;
    margin-top: 1rem;
    border-color: rgba(145, 158, 222, 0.2);
    background: rgba(30, 41, 59, 0.15);
}

.workflow-list-empty[data-for="nested"] .empty-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.workflow-list-empty[data-for="nested"] .empty-title {
    font-size: 0.85rem;
}

.workflow-list-empty[data-for="nested"] .empty-description {
    font-size: 0.75rem;
}

/* Smooth transitions for lists */
#workflow-list,
.slot-steps {
    transition: opacity 0.3s ease;
}

/* Variables Tab Styles */
.variables-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.variables-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.variables-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.variable-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 1.5rem;
    transition: all 0.2s ease;
}

.variable-item:hover {
    border-color: rgba(145, 158, 222, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.variable-inputs {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex: 1;
}

.variable-inputs .form-group {
    margin-bottom: 0;
}

.variable-inputs .form-group:first-child {
    flex: 1;
}

.variable-inputs .form-group:last-child {
    flex: 2;
}

.variable-inputs .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.variable-inputs .form-group input {
    width: 100%;
}

.variable-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 12px;
}

.variable-actions .btn {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* View/Hide button specific styling */
.variable-actions .btn-outline {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(145, 158, 222, 0.3);
}

.variable-actions .btn-outline:hover {
    background: rgba(145, 158, 222, 0.1);
    border-color: rgba(145, 158, 222, 0.5);
    color: #e2e8f0;
}

.variable-actions .btn-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.variable-actions .btn-warning:hover {
    background: rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.6);
    color: #fcd34d;
}

/* Variables responsive design moved to media queries section */

.variable-key,
.variable-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.variable-key {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tab description styling */
.tab-description {
    color: #94a3b8;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Variables layout responsive design moved to media queries section */

/* Variables-specific empty state with reduced padding */
#variables-empty.empty-state {
    padding: 2rem 1.5rem;
}

/* Add spacing between description and button in variables empty state */
#variables-empty .empty-description {
    margin-bottom: 1.5rem;
}

/* ========================================
   MEDIA QUERIES - GROUPED BY BREAKPOINT
   ======================================== */

/* === TABLET AND UP (min-width: 768px) === */
@media (min-width: 768px) {
    /* Logic Layout */
    .logic-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logic-info {
        flex: 1;
        margin-bottom: 0;
    }
}

/* === DESKTOP AND UP (min-width: 769px) === */
@media (min-width: 769px) {
    /* Code Panel */
    .code-panel .CodeMirror {
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
    }
}

/* === LARGE DESKTOP (min-width: 1400px) === */

/* === MOBILE AND TABLET (max-width: 768px) === */
@media (max-width: 768px) {
    /* Main Layout */
    .main-content {
        flex-direction: column;
        height: auto;
    }

    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    /* Dashboard Container Mobile */
    .dashboard-container {
        flex-direction: row;
        min-height: calc(100vh - 80px);
        position: relative;
    }

    /* Off-canvas Sidebar */
    .sidebar-tabs {
        position: fixed;
        top: 80px;
        left: -280px;
        width: 280px;
        height: calc(100vh - 80px);
        padding: 1.5rem 0;
        flex-direction: column;
        overflow-y: auto;
        border-right: 1px solid rgba(145, 158, 222, 0.1);
        gap: 0.25rem;
        background: rgba(15, 23, 42, 0.98);
        z-index: 90;
        transition: left 0.3s ease;
    }

    .sidebar-tabs.active {
        left: 0;
    }

    .sidebar-tabs .tab-btn {
        text-align: left;
        justify-content: flex-start;
        white-space: nowrap;
        border-left: 3px solid transparent;
        border-bottom: none;
        padding: 1rem 1.5rem;
    }

    .sidebar-tabs .tab-btn.active {
        border-left-color: var(--color-primary);
        border-bottom-color: transparent;
    }

    .sidebar-tabs .tab-btn:hover {
        border-left-color: rgba(145, 158, 222, 0.3);
        border-bottom-color: transparent;
    }

    .sidebar-tabs .tab-btn:focus-visible {
        background: rgba(145, 158, 222, 0.15);
        color: #e2e8f0;
        border-left-color: #919ede;
        border-bottom-color: transparent;
        outline: 2px solid #919ede;
        outline-offset: -2px;
        box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.3);
    }

    .sidebar-spacer {
        flex: 1;
        min-height: 2rem;
    }

    .sidebar-back-btn {
        margin-bottom: 0.75rem;
    }

    /* Split Button Mobile Styles */
    .split-button-group {
        margin: 0 1rem 1rem 1rem;
        width: calc(100% - 2rem);
    }

    /* App Cards Mobile Styles */
    .app-actions .split-button-group {
        margin: 0;
        width: auto;
    }

    .content-area {
        width: 100%;
        padding: 1rem;
        margin-left: 0;
    }

    .settings-section {
        padding: 1.5rem 1rem;
    }

    /* Logic Groups Mobile */
    .logic-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .logic-group-actions {
        width: 100%;
    }

    .logic-group-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Variables Mobile */
    .variable-item {
        flex-direction: column;
        gap: 1rem;
    }

    .variable-inputs {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .variable-inputs .form-group {
        width: 100%;
    }

    .variable-inputs .form-group:first-child,
    .variable-inputs .form-group:last-child {
        flex: none;
        width: 100%;
    }

    .variable-inputs .form-group input {
        width: 100%;
        box-sizing: border-box;
    }

    .variable-actions {
        margin-top: 0;
        justify-content: flex-start;
        width: 100%;
    }

    .variable-actions .btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    .variables-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        width: 100%;
    }

    .variables-actions {
        justify-content: space-between;
        width: 100%;
    }

    .variables-actions .btn {
        flex: 1;
        max-width: calc(50% - 0.5rem);
        justify-content: center;
    }

    .user-menu {
        width: 100%;
    }

    /* Create App Page Mobile */
    .wizard-container {
        padding: 1rem;
    }

    .wizard-content {
        padding: 1rem;
    }

    /* Workflow Page Mobile */
    #workflow-list li {
        padding: 0.75rem;
    }

    #workflow-list li button {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .code-panel {
        display: none !important;
    }

    .workflow-panel {
        max-width: 100% !important;
    }

    /* Dashboard Page Mobile */
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    /* Create App Page Mobile */
    .container {
        padding: 0 1rem;
    }

    .bundle-grid {
        grid-template-columns: 1fr;
    }

    .step-label {
        display: none;
    }

    /* Login Page Mobile */
    .login-container,
    .auth-container {
        padding: 1rem;
    }

    .login-box {
        padding: 1.5rem;
    }

    .auth-container {
        padding: 2rem;
        margin: 1rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    /* Header Button Mobile */
    .header button {
        margin-bottom: 0.5rem;
    }

    .header button:not(:first-child) {
        margin-left: 0;
    }

    /* Show mobile menu toggle */
    button.mobile-menu-toggle {
        display: flex;
        margin: 0;
    }

    .sidebar-tabs {
        top: 72.8px;
        height: calc(100vh - 72.8px);
    }
}

/* Styles Tab Specific Styles */
.styles-section {
    padding: 20px;
}

.styles-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 20px;
    flex-wrap: wrap;
}

.styles-header p {
    color: #94a3b8;
    margin: 0;
    flex: 1;
    min-width: 300px;
}

.styles-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Style Group Card */
.style-group-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.style-group-header {
    padding: 20px;
    background: rgba(51, 65, 85, 0.3);
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 20px;
}

.style-group-info {
    flex: 1;
}

.style-group-name {
    margin: 0 0 8px 0;
    color: #e2e8f0;
    font-size: 1.25rem;
    font-weight: 600;
}

.style-group-name .inline-edit-input {
    font-size: inherit;
    font-weight: inherit;
    padding: 4px 6px;
}

.style-group-description {
    margin: 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

.style-group-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Styles Table */
.style-variables-table {
    overflow-x: auto;
}

/* Variable row animations */
.styles-table tbody tr {
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
}

.variable-row-moving-up {
    animation: moveUp 0.3s ease forwards;
}

.variable-row-moving-down {
    animation: moveDown 0.3s ease forwards;
}

.variable-row-being-displaced-up {
    animation: displacedUp 0.3s ease forwards;
}

.variable-row-being-displaced-down {
    animation: displacedDown 0.3s ease forwards;
}

@keyframes moveUp {
    0% {
        transform: translateY(0);
        z-index: 10;
    }
    100% {
        transform: translateY(-100%);
        z-index: 10;
    }
}

@keyframes moveDown {
    0% {
        transform: translateY(0);
        z-index: 10;
    }
    100% {
        transform: translateY(100%);
        z-index: 10;
    }
}

@keyframes displacedUp {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

@keyframes displacedDown {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

.styles-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Fixed column widths for consistent layout */
.styles-table th:nth-child(1),
.styles-table td:nth-child(1) {
    width: auto; /* Name column - grows to fill remaining space */
}

.styles-table th:nth-child(2),
.styles-table td:nth-child(2) {
    width: 20%; /* Min column */
}

.styles-table th:nth-child(3),
.styles-table td:nth-child(3) {
    width: 20%; /* Preferred column */
}

.styles-table th:nth-child(4),
.styles-table td:nth-child(4) {
    width: 20%; /* Max column */
}

.styles-table th:nth-child(5),
.styles-table td:nth-child(5) {
    width: 20%;
    white-space: nowrap;
}

.styles-table thead {
    background: rgba(51, 65, 85, 0.3);
}

.styles-table th {
    padding: 12px;
    text-align: left;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
}

.styles-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    vertical-align: middle;
}

.styles-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.2);
}

.styles-table .empty-row {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 24px;
}

/* Inline Edit Inputs */
.inline-edit-input {
    background: transparent;
    border: 1px solid transparent;
    color: #e2e8f0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    width: 100%;
    transition: all 0.2s ease;
}

.inline-edit-input:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(71, 85, 105, 0.5);
}

.inline-edit-input:focus {
    background: rgba(30, 41, 59, 0.8);
    border-color: #919ede;
    outline: none;
}

.inline-edit-input::placeholder {
    color: #475569;
}

.inline-edit-select {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    color: #e2e8f0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-edit-select:hover {
    border-color: #919ede;
}

.inline-edit-select:focus {
    border-color: #919ede;
    outline: none;
}

/* Color Input */
.color-input {
    width: 60px;
    height: 32px;
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.color-input:hover {
    border-color: #919ede;
}

/* Variable Name Cell with Inline Icon */
.variable-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-icon-inline {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}

.variable-name-input {
    flex: 1;
    min-width: 0; /* Allow input to shrink */
}

/* Variable Name Display */
.variable-name {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: #919ede;
    background: rgba(145, 158, 222, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Small Buttons */
.btn.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* New Variable Row */
.new-variable-row {
    background: rgba(145, 158, 222, 0.1);
}

.new-variable-row .inline-edit-input,
.new-variable-row .inline-edit-select {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(145, 158, 222, 0.3);
}

.new-variable-row .inline-edit-input:focus,
.new-variable-row .inline-edit-select:focus {
    border-color: #919ede;
    box-shadow: 0 0 0 2px rgba(145, 158, 222, 0.2);
}

/* Variable Type Dropdown */
.variable-type-dropdown {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(145, 158, 222, 0.3);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 280px;
    max-width: 320px;
    overflow: hidden;
}

.dropdown-header {
    padding: 12px 16px;
    background: rgba(51, 65, 85, 0.5);
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #e2e8f0;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(51, 65, 85, 0.5);
}

.dropdown-item:active {
    background: rgba(145, 158, 222, 0.2);
}

.type-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.type-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.type-info strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}

.type-info small {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Responsive adjustments for styles tab */
@media (max-width: 768px) {
    .styles-header {
        flex-direction: column;
    }

    .styles-header p {
        min-width: 100%;
    }

    .style-group-header {
        flex-direction: column;
    }

    .styles-table {
        font-size: 0.75rem;
    }

    .styles-table th,
    .styles-table td {
        padding: 8px 4px;
    }

    .variable-name {
        font-size: 0.7rem;
    }
}