/* ==========================================================================
   AppForge Design System & Theme Stylesheet (Vanilla CSS)
   ========================================================================== */

:root {
    --bg-darker: #090b11;
    --bg-dark: #0f121d;
    --bg-card: rgba(22, 28, 45, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #6366f1;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --accent: #a855f7;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --phone-w: 320px;
    --phone-h: 640px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Glow Effects */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background-color: var(--primary);
    top: -100px;
    left: -100px;
}

.bg-glow-2 {
    width: 600px;
    height: 600px;
    background-color: var(--accent);
    bottom: -100px;
    right: -100px;
}

.bg-glow-3 {
    width: 400px;
    height: 400px;
    background-color: #ec4899;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.08;
}

/* Header Component */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background-color: rgba(15, 18, 29, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 30%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Button UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
}

.btn-outline {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-full {
    width: 100%;
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
}

.btn-text:hover {
    color: var(--text-primary);
}

/* App Main Container Grid */
.app-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 120px);
}

/* 1. Left Config Panel */
.config-panel {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Tabs list */
.panel-tabs {
    display: flex;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-bottom: 2px solid transparent;
    min-width: 90px;
}

.tab-btn svg {
    opacity: 0.6;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.02);
}

.tab-btn:hover svg {
    opacity: 1;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.03);
}

.tab-btn.active svg {
    opacity: 1;
    stroke: var(--primary);
}

/* Config Content Area */
.panel-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    max-height: 700px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Form Styles */
.form-group-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.form-group-title.sub-title {
    font-size: 0.95rem;
    margin-top: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.panel-section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"],
input[type="url"],
select,
textarea {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: rgba(0, 0, 0, 0.35);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 2.5rem;
    width: 100%;
}

/* Radio Cards (Platform / Layout selection) */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.radio-card {
    cursor: pointer;
    position: relative;
}

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

.radio-card .card-content {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
    height: 100%;
}

.radio-card:hover .card-content {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.15);
}

.radio-card input[type="radio"]:checked + .card-content {
    background-color: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.card-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* Icon Design Box */
.icon-designer-box {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.icon-generator-layout {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.icon-preview-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-preview-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

/* Shapes for App Icon Preview */
.rounded-sq {
    border-radius: 18px;
}

.circle {
    border-radius: 50%;
}

.square {
    border-radius: 0;
}

.squircle {
    border-radius: 28px;
}

.icon-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.icon-controls .form-group {
    margin-bottom: 0;
}

.color-picker-wrapper {
    position: relative;
    width: 100%;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.color-picker-wrapper input[type="color"] {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 120%;
    height: 120%;
    border: none;
    cursor: pointer;
}

/* Colors Options Styling */
.color-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.color-option-card {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-picker-flex {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker-flex input[type="color"] {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.hex-text {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.3) !important;
    text-align: center;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* Navigation Mockup Icons */
.nav-mockup-icon {
    width: 48px;
    height: 32px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.tabs-mock::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    height: 6px;
    background: var(--primary);
    border-radius: 1px;
}

.drawer-mock::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    bottom: 2px;
    width: 12px;
    background: var(--primary);
    border-radius: 1px;
}

.full-mock::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.nav-details-panel {
    margin-top: 1.5rem;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

/* Tabs list item builder */
.tabs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tab-item-row {
    display: grid;
    grid-template-columns: 32px 1.2fr 1.5fr 36px;
    gap: 0.5rem;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 8px;
    animation: slideDown 0.2s ease-in-out;
}

.tab-drag-handle {
    display: flex;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: grab;
}

.tab-item-row select,
.tab-item-row input {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    background-color: rgba(0, 0, 0, 0.2);
}

.btn-delete-item {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background-color: rgba(239, 68, 68, 0.05);
    color: var(--danger);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-delete-item:hover {
    background-color: var(--danger);
    color: white;
}

/* Native features switches list */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-toggle-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.feature-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feature-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.feature-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.feature-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Toggle Switch Styling */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    transition: .3s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(20px);
    background-color: white;
}

/* Code Editor Container */
.code-editor-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background-color: #0b0d14;
}

.editor-header {
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.lang-label {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--primary);
    font-weight: 700;
}

.code-textarea {
    width: 100%;
    min-height: 120px;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 1rem;
    resize: vertical;
    color: #a78bfa;
}

.code-textarea::placeholder {
    color: var(--text-muted);
}

/* 2. Right Simulator Panel */
.simulator-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(15, 18, 29, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.2);
}

.simulator-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.simulator-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    display: inline-block;
}

.simulator-selector {
    display: flex;
    background-color: rgba(0, 0, 0, 0.25);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.sim-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.sim-toggle-btn.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Device Wrapper styling */
.simulator-device-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Phone Frame Shell */
.phone-frame {
    width: var(--phone-w);
    height: var(--phone-h);
    background-color: #1e293b;
    border: 10px solid #334155;
    border-radius: 42px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition-smooth);
}

/* Platform style toggles */
.phone-frame.ios-mode {
    border-radius: 46px;
    border-color: #1e1e1e;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), inset 0 0 2px rgba(255,255,255,0.4);
}

.phone-frame.android-mode {
    border-radius: 36px;
    border-color: #2d3748;
}

/* Notch & Island */
.phone-island {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 24px;
    background-color: black;
    border-radius: 12px;
    z-index: 40;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-frame.android-mode .phone-island {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    top: 10px;
}

/* Hardware Buttons */
.phone-btn {
    position: absolute;
    background-color: #1e1e1e;
    border-radius: 2px;
    z-index: -1;
}

.ios-mode .phone-btn { background-color: #2b2b2b; }
.android-mode .phone-btn { background-color: #3d4a5d; }

.ringer { top: 75px; left: -14px; width: 4px; height: 15px; }
.vol-up { top: 110px; left: -14px; width: 4px; height: 35px; }
.vol-down { top: 155px; left: -14px; width: 4px; height: 35px; }
.power { top: 130px; right: -14px; width: 4px; height: 45px; }

/* Phone Screen Inner Container */
.phone-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    position: relative;
    overflow: hidden;
    user-select: none;
}

/* Simulator Status Bar */
.phone-status-bar {
    height: 38px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 1.25rem 0.35rem 1.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    z-index: 30;
    color: #ffffff;
    background-color: #0f172a;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.android-mode .phone-status-bar {
    height: 32px;
    align-items: center;
    padding-bottom: 0;
}

.status-time {
    font-family: var(--font-sans);
}

.status-notch-spacer {
    width: 90px;
}

.android-mode .status-notch-spacer {
    width: 0;
}

.status-icons {
    display: flex;
    gap: 0.3rem;
}

/* Phone App Bar */
.phone-app-bar {
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.75rem;
    z-index: 25;
    background-color: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-bar-title {
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.app-bar-btn {
    background: transparent;
    border: none;
    color: inherit;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.app-bar-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* WebView Screens Viewport */
.phone-view-container {
    flex: 1;
    position: relative;
    background-color: #f1f5f9;
}

.sim-webview {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.mock-webview-page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
}

.mock-webview-page.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mock Web Browser Address bar */
.mock-web-header {
    padding: 0.4rem 0.6rem;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.mock-browser-bar {
    background-color: #f1f5f9;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.625rem;
}

.mock-sec-badge {
    color: var(--success);
    font-weight: 700;
}

.mock-url-text {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mock web elements */
.mock-web-body {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Dynamic Real WebView iframe */
#real-webview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.hide-iframe {
    display: none !important;
}

.mock-card-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
}

.hero-card {
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    color: #1e1b4b;
}

.hero-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.4rem;
    animation: bounce 2s infinite;
}

.hero-card h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.hero-card p {
    font-size: 0.7rem;
    color: #4338ca;
    line-height: 1.3;
}

.content-cards {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.content-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.8rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.content-card h5 {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.content-card p {
    font-size: 0.65rem;
    color: #64748b;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.card-buttons {
    display: flex;
    gap: 0.35rem;
}

.test-btn {
    flex: 1;
    font-size: 0.625rem;
    padding: 0.35rem 0.2rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    cursor: pointer;
    font-weight: 600;
    color: #334155;
    transition: var(--transition-smooth);
    text-align: center;
}

.test-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* Splash Loader Screen in Phone */
.sim-splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0f172a;
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    transition: opacity 0.4s ease-out;
    opacity: 0;
    pointer-events: none;
}

.sim-splash-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.sim-splash-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.sim-splash-title {
    font-size: 1.1rem;
    color: white;
    font-weight: 700;
}

.sim-splash-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Drawer / Sidebar Menus in Simulator */
.sim-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 32;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sim-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sim-drawer-content {
    width: 75%;
    height: 100%;
    background-color: #ffffff;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sim-drawer-overlay.active .sim-drawer-content {
    transform: translateX(0);
}

.sim-drawer-header {
    background-color: #0f172a;
    padding: 1.25rem 1rem;
    color: white;
}

.sim-drawer-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.profile-info h4 {
    font-size: 0.85rem;
    font-weight: 700;
}

.profile-info p {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.sim-drawer-menu {
    list-style: none;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    flex: 1;
}

.sim-drawer-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.sim-drawer-item a:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.sim-drawer-item.active a {
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

/* Bottom Navigation Bar in simulator */
.phone-bottom-nav {
    height: 52px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 25;
    padding-bottom: 2px;
    transition: var(--transition-smooth);
}

.ios-mode .phone-bottom-nav {
    height: 58px;
    padding-bottom: 12px;
}

.phone-bottom-nav.hide {
    display: none !important;
}

.nav-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: transparent;
    border: none;
    outline: none;
}

.nav-tab-item-icon {
    font-size: 1.1rem;
}

.nav-tab-item-label {
    font-size: 0.58rem;
    font-weight: 700;
}

.nav-tab-item.active {
    color: var(--primary);
}

/* Home Indicator Bar (iOS style bottom bar) */
.phone-home-indicator {
    height: 5px;
    width: 110px;
    background-color: #000000;
    border-radius: 99px;
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    display: none;
}

.ios-mode .phone-home-indicator {
    display: block;
}

.sim-hint {
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* 3. Compilation Modal Window */
.compiler-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(9, 11, 17, 0.7);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.compiler-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.compiler-box {
    width: 640px;
    max-width: 90vw;
    background-color: #0f121d;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.compiler-header {
    background-color: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compiler-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.console-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.console-dot.red { background-color: var(--danger); }
.console-dot.yellow { background-color: var(--warning); }
.console-dot.green { background-color: var(--success); }

.console-title-text {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-left: 0.4rem;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.close-modal-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.close-modal-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Terminal compiler output area */
.compiler-terminal {
    background-color: #06070a;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #cbd5e1;
    padding: 1.25rem;
    height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    line-height: 1.5;
}

.terminal-line {
    animation: fadeInShort 0.15s ease-out forwards;
}

.line-time {
    color: var(--text-muted);
}

.tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    margin-right: 0.4rem;
}

.tag-info { background-color: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.tag-success { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
.tag-warning { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); }
.tag-error { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Progress bar inside Compiler Box */
.compiler-progress-container {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.1);
}

.progress-bar-bg {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 99px;
    transition: width 0.1s linear;
}

.progress-status-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.status-percentage {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
}

.status-label {
    color: var(--text-secondary);
}

/* Download Portal */
.download-portal {
    padding: 1.5rem;
    text-align: center;
    background-color: #0c0f18;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-portal h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.download-portal p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.download-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 0.8fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.download-option-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: var(--transition-smooth);
}

.download-option-card:hover {
    border-color: rgba(255,255,255,0.15);
    background-color: rgba(255,255,255,0.03);
}

.dl-icon {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.download-option-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
}

.download-option-card p {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-bottom: 0.75rem;
    text-align: left;
}

.dl-btn {
    margin-top: auto;
    font-size: 0.78rem;
    padding: 0.5rem 1rem;
}

/* QR box container */
.download-qr-box {
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: rgba(0, 0, 0, 0.1);
}

.qr-code-placeholder {
    width: 100px;
    height: 100px;
    background-color: white;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
}

.portal-actions {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.hide {
    display: none !important;
}

/* Toast Notifications styling */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background-color: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 12px rgba(99,102,241,0.1);
    border-left: 4px solid var(--primary);
    padding: 0.8rem 1.25rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 200;
    transform: translateY(150px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.active {
    transform: translateY(0);
}

.toast-icon {
    font-size: 1.1rem;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInShort {
    from { opacity: 0; transform: translateX(-3px); }
    to { opacity: 1; transform: translateX(0); }
}

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

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

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ==========================================================================
   Responsive Viewports Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .simulator-panel {
        order: -1;
        min-height: auto;
        padding: 1.5rem;
    }
    
    .simulator-device-wrapper {
        margin: 1.5rem 0;
    }
}

@media (max-width: 640px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-nav {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .app-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .panel-content {
        padding: 1.25rem;
    }
    
    .color-options-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-cards {
        grid-template-columns: 1fr;
    }
    
    .download-grid {
        grid-template-columns: 1fr;
    }
}
