/* App Builder Styles */

/* Custom scrollbar Styling */
::-webkit-scrollbar {
    width: 4px; /* Slim, minimal scrollbar width */
    height: 4px; /* Consistent height for horizontal scrollbars */
}

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

::-webkit-scrollbar-thumb {
    background: #30363D;
    border-radius: 4px;
    min-height: 30px; /* Slightly reduced minimum height */
    max-height: 60px; /* Further reduced maximum height for a more proportional look */
}

::-webkit-scrollbar-thumb:hover {
    background: #4D5562;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    width: 100% !important;
}

body.app-builder-body {
    padding-top: 0 !important;
}

.app-builder-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: #0D1117;
    color: #E6EDF3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    width: 100vw;
    max-width: 100%;
}

/* Header */
.app-builder-body .app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #0D1117;
    height: 60px;
    border-bottom: 1px solid #21262D;
    width: 100vw !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    border-bottom: 1px solid #21262D !important;
}

.app-header-left {
    display: flex;
    align-items: center;
    position: relative;
    margin-left: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    position: relative;
}

.app-header-left .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.app-header-left img {
    width: 40px;
    height: auto;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 20px;
}

.header-btn {
    background-color: transparent;
    color: #E6EDF3;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.header-btn:hover {
    color: #E6E6E6; /* Same color as Create a new App button hover */
    background-color: #1C2027; /* Light gray background on hover */
}

.icon-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: transparent;
    color: #E6EDF3;
    border: 1px solid #30363D;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
    background-color: #30363D;
    border-color: #8B949E;
}

.icon-btn svg {
    color: #E6EDF3;
}

.github-icon, .apple-icon {
    width: 18px;
    height: 18px;
}

.create-app-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #FFFFFF;
    color: #000000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    height: 36px;
}

.create-app-btn:hover {
    background-color: #E6E6E6;
}

.chevron-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: -25px; /* Moved significantly closer to the logo */
    border-radius: 4px;
    cursor: pointer;
    position: relative; /* Added to ensure positioning works */
    z-index: 100; /* Increased to ensure dropdown is above other elements */
}

.chevron-wrapper:hover {
    background-color: #1C2027;
}

/* Logo dropdown styles */
.logo-dropdown {
    position: absolute;
    top: 45px;
    left: -20px;
    width: 350px;
    background-color: #0D1117;
    border: 1px solid #30363D;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 100;
    overflow: hidden;
    display: none; /* Hidden by default */
}

.logo-dropdown.active {
    display: block;
}

.logo-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #21262D;
}

.dashboard-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #FFFFFF;
    font-size: 18px;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.dashboard-link:hover {
    background-color: #161B22;
}

.dashboard-icon {
    stroke: #FFFFFF;
}

.logo-dropdown-section {
    padding: 16px;
    border-bottom: 1px solid #21262D;
}

.section-title {
    color: #9A9A9A;
    font-size: 18px;
}

.logo-dropdown-apps {
    padding: 8px 0;
}

.app-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 18px;
    transition: background-color 0.2s ease;
}

.app-item:hover {
    background-color: #161B22;
}

.chevron-right {
    stroke: #FFFFFF;
}

/* Removed hover style */

.chevron-down {
    width: 14px;
    height: 14px;
    stroke: #E6EDF3;
    transition: transform 0.2s ease;
}

.chevron-wrapper.active .chevron-down {
    transform: rotate(180deg);
}

/* Main content */
.app-main {
    display: grid;
    grid-template-columns: minmax(350px, 1.2fr) minmax(350px, 1.2fr) minmax(350px, 1.2fr);
    height: calc(100vh - 100px);
    overflow: hidden;
    width: 100vw;
    max-width: 100%;
    position: relative;
    padding: 0;
    margin: 0;
}

/* Sidebar */
.app-sidebar {
    background-color: #0D1117;
    border-right: 1px solid #21262D;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: visible; /* Changed from hidden to visible */
    width: 100%;
    min-height: 0; /* Ensures proper flexbox behavior */
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: none;
    font-weight: 500;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
}

/* Add a full-width border that extends edge to edge */
.app-main {
    position: relative;
}

.app-main::before {
    content: '';
    position: absolute;
    top: 50px; /* Height of panel header */
    left: -50vw; /* Extend far beyond the left edge */
    width: 200vw; /* Much wider than needed to ensure coverage */
    height: 1px;
    background-color: #21262D;
    z-index: 10;
}

/* Add a full-width line that extends edge to edge */
.full-width-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #21262D;
    width: 100vw;
    z-index: 10;
    margin: 0;
    padding: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #1C2027; /* Light gray container */
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.chat-icon {
    stroke: #2F81F7; /* Blue */
    margin-left: 3px; /* Pushed in slightly */
}

.preview-icon {
    stroke: #3FB950; /* Green */
}

.code-icon {
    stroke: #F97316; /* Orange */
}

/* Override the background image code icon from styles.css for the panel title */
.panel-title .code-icon {
    background-image: none !important;
}

.arrow-down-icon {
    stroke: #8B949E;
    width: 14px;
    height: 14px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.device-selector.active .arrow-down-icon {
    transform: rotate(180deg);
}

.chat-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 50px);
    position: relative;
    overflow: hidden;
    padding-top: 1px; /* Add a small padding to ensure content starts below the divider */
    min-height: 0; /* Ensures flexbox children can shrink below their content size */
}

.chat-messages {
    flex: 1 1 auto; /* Allow growing and shrinking */
    overflow-y: auto;
    background-color: #0D1117;
    min-height: 100px; /* Minimum height to ensure there's always space for messages */
    padding-bottom: 80px; /* Space for input area */
    padding-top: 10px; /* Add padding to push content below the divider line */
    margin-top: 1px; /* Ensure content starts below the divider line */
}

/* Custom scrollbar specifically for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #30363D;
    border-radius: 4px;
    min-height: 40px; /* Minimum height for better visibility */
    max-height: 100px; /* Limit the height of the scrollbar thumb */
}

.chat-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    border-top: none;
    background-color: #0D1117;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    padding-right: 10px;
    z-index: 50; /* Ensure the input stays on top */
    min-height: 60px; /* Minimum height to prevent disappearing */
    overflow: visible; /* Allow modal to show outside */
}

.message-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 14px;
    color: #E6EDF3;
}

.input-container {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0; /* Remove gap, use margin on individual elements */
    border: 1px solid #30363D;
    border-radius: 6px;
    padding: 0.25rem;
    background-color: #161B22;
    position: relative;
    width: 90%;
    max-width: 90%;
    margin: 0 auto;
    transform: translateX(-10px);
    overflow: visible; /* Allow modal to show outside */
    flex-wrap: nowrap; /* Prevent wrapping */
}

/* Explicit ordering for all input-container children */
.input-container > .chat-attach-icon-btn {
    order: 1 !important;
}

.input-container > .chat-voice-icon-btn {
    order: 2 !important;
}

.input-container > #builder-model-selector {
    order: 3 !important;
}

.input-container > .chat-input {
    order: 4 !important;
}

.input-container > .chat-send-btn {
    order: 5 !important;
}

/* Builder page attach icon button */
.chat-attach-icon-btn {
    background-color: transparent;
    color: #8B949E;
    border: none;
    width: 32px;
    height: 32px;
    min-width: 32px; /* Prevent shrinking */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    order: 1 !important;
    padding: 0;
    flex-shrink: 0; /* Never shrink */
}

.chat-attach-icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: #8B949E;
    transition: stroke 0.2s ease;
}

.chat-attach-icon-btn:hover {
    color: #E6EDF3;
}

.chat-attach-icon-btn:hover svg {
    stroke: #E6EDF3;
}

/* Builder page voice icon button */
.chat-voice-icon-btn {
    background-color: transparent;
    color: #8B949E;
    border: none;
    width: 32px;
    height: 32px;
    min-width: 32px; /* Prevent shrinking */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    order: 2 !important;
    padding: 0;
    flex-shrink: 0; /* Never shrink */
}

.chat-voice-icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: #8B949E;
    transition: stroke 0.2s ease;
}

.chat-voice-icon-btn:hover {
    color: #E6EDF3;
}

.chat-voice-icon-btn:hover svg {
    stroke: #E6EDF3;
}

.chat-input {
    flex: 1 1 auto;
    min-width: 0; /* Allow shrinking below content size */
    background-color: transparent;
    border: none;
    color: #E6EDF3;
    padding: 0.5rem;
    outline: none;
    font-size: 14px;
    order: 4 !important; /* Position in middle */
    margin-left: 8px; /* Space from model selector */
}

.chat-input::placeholder {
    color: #8B949E;
}

.chat-send-btn {
    background-color: #2F81F7;
    color: #FFFFFF;
    border: none;
    width: 36px;
    height: 36px;
    min-width: 36px; /* Prevent shrinking */
    border-radius: 4px; /* Changed from 50% (circle) to 4px (square) */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    order: 5 !important; /* Position last */
    margin-left: 8px; /* Space from input */
    flex-shrink: 0; /* Never shrink */
}

.chat-send-btn:hover {
    background-color: #1a6fd1; /* Darker blue on hover */
}

.send-icon {
    width: 16px;
    height: 16px;
    stroke: #FFFFFF;
    fill: none;
}

/* Workspace */
.app-workspace {
    background-color: #0D1117;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-right: 1px solid #21262D;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #21262D;
    background-color: #0D1117;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.preview-section, .device-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
}

.device-preview {
    width: 100%;
    height: calc(100% - 50px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    background-color: #0D1117;
    /* Force the background color to match other panels */
    background: #0D1117 !important;
    position: relative;
    min-height: 800px;
    padding: 10px;
    box-sizing: border-box;
}

/* Ensure the preview content has the correct background */
.device-preview .iphone-outline {
    background-color: #FFFFFF;
}

.device-frame {
    position: relative;
    width: 380px;
    height: 720px;
    z-index: 5;
    margin: auto;
    /* Fixed position in the center of the preview panel */
    top: auto;
    left: auto;
    transform: none;
}

.iphone-outline {
    width: 100%;
    height: 100%;
    border: 2px solid #30363D;
    border-radius: 40px;
    position: relative;
    background-color: #000000;
    overflow: hidden;
}

.iphone-outline:before {
    content: '';
    position: absolute;
    width: 40%;
    height: 25px;
    background: #1C2027;
    left: 30%;
    top: 0;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Code sidebar */
.code-sidebar {
    border-right: none;
    background-color: #0D1117;
}

.files-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Separate styling for files-title to wrap only the Files label and icon */
.files-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #1C2027; /* Light gray container */
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Separate styling for download icon */
.download-icon {
    stroke: #E6EDF3;
    width: 18px;
    height: 18px;
    cursor: pointer;
    background-color: #1C2027; /* Light gray container */
    padding: 0.25rem;
    border-radius: 4px;
}

/* Styling moved to a new location above */

.files-icon, .download-icon {
    stroke: #E6EDF3;
    width: 18px;
    height: 18px;
}

.download-icon {
    cursor: pointer;
}

.code-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 50px);
    position: relative;
    overflow: hidden;
}

.file-explorer {
    font-size: 14px;
    color: #E6EDF3;
    display: none; /* Hide file explorer by default */
    position: absolute;
    top: 50px; /* Position below the Files button */
    right: 10px;
    background-color: #0D1117;
    border: 1px solid #21262D;
    border-radius: 6px;
    height: 70%; /* Reduced height */
    width: 300px; /* Slightly wider for better readability */
    z-index: 10;
    overflow-y: auto;
    padding: 0; /* Remove padding, we'll add it to inner elements */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-height: calc(100vh - 200px);
}

.file-explorer.active {
    display: block; /* Show file explorer when active */
}

/* File explorer header */
.file-explorer-header {
    padding: 12px 16px;
    border-bottom: 1px solid #30363D;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #161B22;
    position: sticky;
    top: 0;
    z-index: 2;
}

.file-explorer-title {
    font-weight: 600;
    font-size: 14px;
    color: #E6EDF3;
}

.file-explorer-content {
    padding: 8px 0;
}

/* Code content area with fixed tabs */
.code-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Style for the code content view */
.code-content-view {
    width: 100%;
    height: calc(100% - 40px); /* Subtract tab height */
    overflow-y: auto;
    flex: 1 1 auto;
    position: relative;
    min-height: 0; /* Allows proper scrolling in flex containers */
}

/* Custom scrollbar specifically for code content */
.code-content-view::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.code-content-view::-webkit-scrollbar-thumb {
    background: #30363D;
    border-radius: 3px;
    min-height: 30px;
    max-height: 40px; /* Further reduced from 50px to 40px for optimal proportions */
}

/* Code editor tabs */
.code-tabs {
    display: flex;
    background-color: #161B22;
    border-bottom: 1px solid #30363D;
    overflow-x: auto;
    height: 40px;
    width: 100%;
    flex-shrink: 0;
}

/* Custom scrollbar specifically for code tabs */
.code-tabs::-webkit-scrollbar {
    height: 3px; /* Even smaller for the horizontal tab scrollbar */
}

.code-tabs::-webkit-scrollbar-thumb {
    background: #30363D;
    border-radius: 2px;
}

.code-tab {
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 40px;
    background-color: #161B22;
    color: #8B949E;
    border-right: 1px solid #30363D;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
}

.code-tab.active {
    background-color: #0D1117;
    color: #E6EDF3;
    border-bottom: 2px solid #2F81F7;
}

.code-tab-close {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #8B949E;
}

.code-tab-close:hover {
    background-color: #30363D;
    color: #E6EDF3;
}

.code-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8B949E;
    font-size: 16px;
    text-align: center;
    overflow-y: auto;
}

/* Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #0D1117;
    border-top: none; /* Ensuring no border is defined here */
    height: 60px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Full-width border at the top of the footer */
.app-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #21262D;
    z-index: 10;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.footer-nav a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    padding-bottom: 2px;
    transition: opacity 0.2s ease;
}

.footer-nav a:hover {
    opacity: 0.8;
}

.footer-nav a:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #FFFFFF;
}

.keyboard-dropdown-container {
    position: relative;
}

.keyboard-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #30363D;
    background-color: #21262D;
    color: #E6EDF3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.keyboard-btn:hover {
    background-color: #30363D;
    border-color: #8B949E;
}

.discord-help {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 18px;
    font-weight: 600;
    color: #8B949E;
    cursor: pointer;
    transition: color 0.2s ease;
}

.discord-help:hover {
    color: #E6EDF3;
}

.discord-help:hover .discord-icon {
    color: #5865F2; /* Discord brand color */
}

.discord-icon {
    width: 24px;
    height: 24px;
    color: #8B949E;
}

/* App Store Modal Specific Styles */
.appstore-title {
    font-size: 22px;
    color: #FFFFFF;
    margin: 0 0 12px 0;
    font-weight: 600;
    text-align: left;
}

.appstore-subtitle {
    font-size: 16px;
    color: #9A9A9A;
    margin: 0 0 10px 0;
    font-weight: 500;
    text-align: left;
}

.appstore-steps {
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.steps-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.step-number-cell {
    width: 60px; /* Increased from 30px to give more space */
    vertical-align: middle;
    padding: 0;
}

.step-content-cell {
    vertical-align: middle;
    padding: 0;
}

.appstore-step {
    font-size: 14px;
    color: #FFFFFF;
    height: 55px; /* Increased from 45px to give more vertical space */
}

.step-number {
    width: 36px; /* Increased from 30px */
    height: 36px; /* Increased from 30px */
    background-color: #1E1E1E;
    border-radius: 50%;
    margin: 0 auto; /* Centered in cell */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: #FFFFFF;
}

.step-content {
    display: flex;
    align-items: center;
    height: 100%; /* Ensure full height of container */
}

.step-icon {
    margin-right: 10px; /* Increased from 8px */
    font-size: 16px; /* Increased from 14px */
}

.step-text {
    font-size: 15px; /* Increased from 14px */
    line-height: 1.3; /* Added to improve text spacing */
}

.appstore-connect-container {
    margin-top: 15px;
}

.appstore-connect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #2F81F7;
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.appstore-connect-btn:hover {
    background-color: #2563EB;
}

.apple-logo {
    width: 16px;
    height: 16px;
    color: #FFFFFF;
}

/* Dropdown header */
.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #21262D;
    text-align: left;
}

.user-info {
    color: #E6EDF3;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.user-info > div {
    text-align: left;
    align-self: flex-start;
}

.user-plan {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
    color: #8B949E;
}

.plan-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #E6EDF3;
    border-radius: 50%;
}

/* Dropdown menu items */
.dropdown-menu {
    padding: 16px 0;
    border-bottom: 1px solid #21262D;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #E6EDF3;
    text-decoration: none;
    font-size: 18px;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #161B22;
}

.upgrade-note {
    color: #9A9A9A;
    font-size: 14px;
    margin-left: 8px;
}

/* Modals - Common Styles */
/* Upgrade Modal - Centered on screen */
.upgrade-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none; /* Hidden by default */
}

.upgrade-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Button Containers */
.github-button-container,
.appstore-button-container {
    position: relative;
    display: inline-block;
}

/* Modals - Appear below their respective buttons */
.appstore-modal {
    position: absolute;
    top: 100%;
    left: 0;
    width: auto;
    height: auto;
    background-color: transparent;
    z-index: 1000;
    display: none; /* Hidden by default */
}

.appstore-modal.active {
    display: block;
}

.upgrade-modal-content {
    background-color: #0D1117;
    border: 1px solid #30363D;
    width: 380px;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.upgrade-modal-header {
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 15px;
}

.upgrade-logo {
    width: 70px;
    height: 70px;
}

.upgrade-modal .modal-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #FFFFFF;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.appstore-modal .modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #B0B0B0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.appstore-modal .modal-close-btn:hover .close-icon {
    stroke: #FFFFFF;
    transform: scale(1.1);
}

.modal-close-btn:hover {
    background-color: transparent;
}

.close-icon {
    stroke: #B0B0B0;
    transition: all 0.2s ease;
}

.modal-close-btn:hover .close-icon {
    stroke: #FFFFFF;
    transform: scale(1.1);
}

.upgrade-title {
    font-size: 28px;
    color: #FFFFFF;
    margin: 0 0 10px 0;
}

.upgrade-subtitle {
    font-size: 18px;
    color: #FFFFFF !important;
    margin: 0 0 20px 0;
    text-align: center;
}

.plan-details {
    margin-bottom: 20px;
    border: 1px solid #3B82F6;
    border-radius: 8px;
    padding: 15px 0;
    margin: 0 20px 20px 10px;
    width: calc(100% - 30px);
}

.plan-name {
    font-size: 36px;
    color: #FFFFFF;
    margin: 0 0 5px 0;
    text-align: left;
    padding-left: 20px;
}

.plan-price {
    font-size: 36px;
    color: #FFFFFF;
    margin: 0 0 20px 0;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    padding-left: 20px;
    text-align: left;
}

.price-period {
    font-size: 24px;
    color: #FFFFFF !important;
}

.plan-description {
    font-size: 18px;
    color: #FFFFFF;
    margin: 0 0 20px 0;
    text-align: left;
    padding-left: 20px;
}

.plan-features {
    list-style-type: none;
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%;
    padding-left: 20px;
}

.plan-features li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: #FFFFFF;
}

.check-icon {
margin-right: 10px;
color: #3B82F6;
width: 20px;
height: 20px;
flex-shrink: 0;
}

.upgrade-now-btn {
    background-color: #3B82F6;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    width: calc(100% - 40px);
    margin: 30px auto 15px;
    display: block;
    transition: background-color 0.2s ease;
}

.upgrade-now-btn:hover {
    background-color: #2563EB;
}

/* Waitlist Modal Styles */
.waitlist-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.waitlist-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.waitlist-modal-content {
    background-color: #1A1A1A;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #333;
}

.waitlist-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.waitlist-logo {
    width: 40px;
    height: 40px;
}

.waitlist-title {
    color: #FFFFFF;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.waitlist-subtitle {
    color: #B0B0B0;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    text-align: center;
}

.waitlist-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.waitlist-prompt {
    color: #FFFFFF;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.waitlist-input {
    background-color: #2A2A2A;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px 16px;
    color: #FFFFFF;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.waitlist-input:focus {
    border-color: #F59E0B;
}

.waitlist-input::placeholder {
    color: #666;
}

.waitlist-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.waitlist-cancel-btn {
    background-color: transparent;
    border: 1px solid #666;
    color: #B0B0B0;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.waitlist-cancel-btn:hover {
    border-color: #888;
    color: #FFFFFF;
}

.waitlist-submit-btn {
    background-color: #F59E0B;
    border: none;
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex: 1;
}

.waitlist-submit-btn:hover {
    background-color: #D97706;
}

.waitlist-submit-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.waitlist-status {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.waitlist-status.success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid #22C55E;
    color: #22C55E;
}

.waitlist-status.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #EF4444;
    color: #EF4444;
}

/* GitHub Modal Specific Styles */
.github-modal {
    position: absolute;
    top: calc(100% + 8px); /* 8px gap below the button */
    right: 0; /* Align to the right edge of the button container */
    width: 320px; /* Fixed width for better control */
    max-width: 90vw; /* Responsive for small screens */
    background-color: transparent;
    z-index: 1000;
    display: none; /* Hidden by default */
    /* Remove pointer-events on overlay but keep on content */
    pointer-events: none;
}

.github-modal.active {
    display: block;
}

.github-modal-content {
    background-color: #0D1117;
    border: 1px solid #30363D;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    position: relative;
    /* Enable pointer events on content */
    pointer-events: auto;
    /* Smooth entrance animation */
    transform: translateY(-8px);
    opacity: 0;
    transition: all 0.2s ease-out;
}

.github-modal.active .github-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.github-title {
    font-size: 20px;
    color: #FFFFFF;
    margin: 0 0 8px 0;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.github-title::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath fill='%23ffffff' d='M12 0a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2.2c-3.3.7-4-1.6-4-1.6-.5-1.3-1.3-1.7-1.3-1.7-1.1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.8-1.6-2.8-.3-5.7-1.4-5.7-6.2 0-1.4.5-2.5 1.3-3.4-.1-.3-.6-1.6.1-3.3 0 0 1-.3 3.3 1.2a11.5 11.5 0 0 1 6 0C17 3.1 18 3.4 18 3.4c.7 1.7.3 3 .1 3.3.8.9 1.3 2 1.3 3.4 0 4.8-2.9 5.9-5.7 6.2.4.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6A12 12 0 0 0 12 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.github-subtitle {
    font-size: 14px;
    color: #9A9A9A;
    margin: 0 0 20px 0;
    line-height: 1.5;
    text-align: left;
}

.github-connect-container {
    margin-top: 16px;
    text-align: left;
}

.github-connect-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.github-connect-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.github-connect-btn:active {
    transform: translateY(0);
}

.github-connect-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.github-modal .modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #B0B0B0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.github-modal .modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.github-modal .modal-close-btn .close-icon {
    transition: all 0.2s ease;
}

.github-modal .modal-close-btn:hover .close-icon {
    stroke: #FFFFFF;
    transform: scale(1.1);
}

/* Connection status styles */
.github-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #161B22;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #30363D;
}

.github-status.connected {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.github-status.error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    transition: all 0.3s ease;
}

.status-dot.connecting {
    background: #ffa500;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.connected {
    background: #2563eb;
}

.status-dot.error {
    background: #ff6b6b;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    color: #E6EDF3;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive design for GitHub modal */
@media (max-width: 768px) {
    .github-modal {
        right: -10px; /* Adjust for mobile */
        width: 280px;
    }
    
    .github-modal-content {
        padding: 16px;
    }
    
    .github-title {
        font-size: 18px;
    }
    
    .github-subtitle {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .github-modal {
        right: -20px;
        width: 260px;
        max-width: calc(100vw - 40px);
    }
}

/* Dropdown footer */
.dropdown-footer {
    padding: 16px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FF0000;
    text-decoration: none;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.logout-btn:hover {
    background-color: #161B22;
}

.logout-icon {
    stroke: #FF0000;
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

.help-link {
    color: #2F81F7;
    text-decoration: none;
}

.help-link:hover {
    text-decoration: underline;
}

.device-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    background-color: #1C2027; /* Light gray container */
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.device-selector:hover {
    background-color: #2A2D3A;
}

.device-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #0D1117;
    border: 1px solid #30363D;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-height: 300px;
    overflow-y: auto;
    min-width: 200px;
    z-index: 100;
    margin-top: 8px;
    display: none;
}

.device-dropdown.active {
    display: block;
}

.device-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #21262D;
    color: #E6EDF3;
    font-size: 14px;
}

.device-option:hover {
    background-color: #161B22;
}

.device-option:last-child {
    border-bottom: none;
}

/* Keyboard dropdown menu */
.keyboard-dropdown {
    position: absolute;
    bottom: 50px;
    left: -10px;
    width: 300px;
    background-color: #0D1117;
    border: 1px solid #30363D;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none; /* Hidden by default */
    overflow: hidden;
}

/* Show dropdown when active */
.keyboard-dropdown.active {
    display: block;
}

/* Password Modal Styles */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
}

.password-modal.active {
    display: flex;
}

.password-modal-content {
    background-color: #0D1117;
    border: 1px solid #30363D;
    width: 550px;
    border-radius: 8px;
    padding: 40px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.password-title {
    font-size: 28px;
    color: #FFFFFF;
    margin: 0 0 40px 0;
    font-weight: 600;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.password-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.password-field label {
    font-size: 18px;
    color: #FFFFFF;
    font-weight: 500;
}

.password-input {
    background-color: #1A212E;
    border: 1px solid #30363D;
    border-radius: 6px;
    height: 50px;
    width: 100%;
    color: #FFFFFF;
    font-size: 16px;
    padding: 0 15px;
    outline: none;
}

.password-input:focus {
    border-color: #2F81F7;
}

.update-password-btn {
    background-color: #FFFFFF;
    color: #000000;
    border: none;
    border-radius: 6px;
    height: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    width: 200px;
    align-self: flex-start;
    transition: background-color 0.2s ease;
}

.update-password-btn:hover {
    background-color: #E6E6E6;
}

/* Add styling for the password modal close button */
.password-modal .modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #B0B0B0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.password-modal .modal-close-btn:hover .close-icon {
    stroke: #FFFFFF;
    transform: scale(1.1);
}

/* Add new styles for chat, file explorer, and code display */

/* Chat message styles */
.chat-message {
    padding: 0;
    margin-bottom: 12px;
    border-radius: 0;
    max-width: 90%;
    animation: fadeIn 0.3s ease-in-out;
}

.user-message {
    background-color: #4263eb;
    margin-left: auto;
    margin-right: 10px;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
}

.assistant-message {
    background-color: transparent;
    margin-right: auto;
    margin-left: 10px;
    color: #f0f0f0;
}

.error-message {
    background-color: rgba(220, 53, 69, 0.2);
    border-left: 3px solid #dc3545;
}

.message-content {
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

/* App Features & Overview header styling */
.app-features-header {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f0f0f0;
    line-height: 1.4;
}

/* Larger text for app features content */
.app-features-content {
    font-size: 15px;
    line-height: 1.6;
    color: #f0f0f0;
}

.message-time {
    font-size: 11px;
    color: #868e96;
    margin-top: 4px;
    text-align: right;
}

/* Loading indicator */
.loading-message {
    background-color: transparent;
}

.typing-indicator {
    display: flex;
    align-items: center;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #6c757d;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    animation: bounce 1.3s linear infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

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

/* File changes display */
.file-changes {
    background-color: rgba(255, 255, 255, 0.02);
    margin: 15px 10px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 95%;
    width: calc(100% - 20px);
    overflow: hidden;
}

/* File changes app header (top section with logo and name) */
.file-changes-app-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scaleify-logo-img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 4px;
}

.file-changes-app-name {
    font-size: 14px;
    font-weight: 500;
    color: #c9d1d9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* File changes collapse header (collapsible section) */
.file-changes-collapse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background-color: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.file-changes-collapse-header:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.file-changes-collapse-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-changes-toggle {
    background: none;
    border: none;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #8b949e;
    transition: all 0.2s ease;
}

.file-changes-toggle:hover {
    color: #c9d1d9;
}

.file-changes.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.file-changes.collapsed .file-changes-list {
    display: none;
}

.file-changes.collapsed .file-changes-actions {
    display: none;
}

.file-changes-count {
    font-size: 13px;
    font-weight: 500;
    color: #c9d1d9;
}

.file-changes-collapse-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
}

.total-added {
    color: #3fb950;
}

.total-removed {
    color: #f85149;
}

.file-changes-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #e6edf3;
}

.file-changes-list {
    padding: 0;
    margin: 0;
}

.file-change-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.15s ease;
}

.file-change-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.file-change-item:last-child {
    border-bottom: none;
}

.file-change-status {
    margin-right: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.change-status-icon {
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.change-status-icon.pending {
    color: #8b949e;
}

.change-status-icon.accepted {
    color: #238636;
}

.file-change-path {
    flex: 1;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #c9d1d9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-change-diff {
    margin-left: auto;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

.lines-added {
    color: #3fb950;
    margin-right: 8px;
}

.lines-removed {
    color: #f85149;
}

.file-changes-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.01);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.accept-changes-btn, .decline-changes-btn {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 6px;
}

.accept-changes-btn {
    background-color: #238636;
    color: white;
    border: none;
}

.accept-changes-btn:hover {
    background-color: #2ea043;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.3);
}

.decline-changes-btn {
    background-color: transparent;
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.decline-changes-btn:hover {
    background-color: rgba(248, 81, 73, 0.1);
    border-color: #f85149;
}

.accept-icon, .decline-icon {
    width: 16px;
    height: 16px;
}

/* File explorer styles */
.file-tree {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

.file-tree ul {
    list-style-type: none;
    padding-left: 16px;
    margin: 0;
    display: none;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

/* Folder expansion styling handled by other rules */

.folder-name {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    transition: background-color 0.2s;
    user-select: none;
}

.folder-name:hover {
    background-color: #1F2937;
}

.folder-icon {
    margin-right: 8px;
    color: #79C0FF;
    min-width: 16px;
}

.folder-toggle {
    margin-right: 6px;
    transition: transform 0.2s;
    color: #8B949E;
    min-width: 16px;
}

.folder-item.expanded > .folder-name .folder-toggle {
    transform: rotate(90deg);
}

.folder-item > .file-tree {
    display: none;
    padding-left: 16px;
}

.folder-item.expanded > .file-tree {
    display: block;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 0;
}

.file-item:hover {
    background-color: #1F2937;
}

.file-icon {
    margin-right: 8px;
    color: #8B949E;
    min-width: 16px;
}

.swift-icon {
    color: #F9826C;
}

.config-icon {
    color: #79C0FF;
}

.file-item.selected {
    background-color: #1F6FEB;
}

.no-files {
    padding: 16px;
    color: #8B949E;
    text-align: center;
    font-style: italic;
}

/* Code content display */
.code-content-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #0d1117;
    overflow: hidden;
}

.code-header {
    padding: 8px 16px;
    background-color: #161b22;
    border-bottom: 1px solid #21262d;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #8b949e;
}

.code-display {
    flex: 1;
    margin: 0;
    padding: 0;
    overflow: auto;
    background-color: #0d1117;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #c9d1d9;
    position: relative;
}

.code-display code {
    white-space: pre;
}

/* Syntax highlighting */
.keyword {
    color: #ff7b72;
}

.string {
    color: #a5d6ff;
}

.comment {
    color: #8b949e;
}

/* Preview panel styles */
.preview-content-view {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: white;
    color: black;
}

.preview-placeholder {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.preview-app-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 12px;
}

.preview-app-message {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

/* No files message */
.no-files {
    padding: 20px;
    text-align: center;
    color: #8b949e;
    font-style: italic;
}

/* Compilation feedback styles */
.compilation-error {
    border-left: 4px solid #ff4444;
}

.compilation-warning {
    border-left: 4px solid #ffaa00;
}

.compilation-success {
    border-left: 4px solid #00aa44;
}

.compilation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
}

.compilation-details {
    margin-left: 24px;
}

.compilation-item {
    display: flex;
    gap: 8px;
    margin: 4px 0;
    font-size: 14px;
}

.compilation-item.error {
    color: #ff6666;
}

.compilation-item.warning {
    color: #ffcc66;
}

.line-number {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 600;
    min-width: 60px;
}

.error-message,
.warning-message {
    flex: 1;
}

.compilation-metrics {
    display: flex;
    gap: 16px;
    margin-left: 24px;
    font-size: 12px;
    color: #888;
}

.metric {
    padding: 2px 8px;
    background: #2a2a2a;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Style for no recent apps message */
.no-recent-apps {
    padding: 12px 16px;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
}

/* Accepted files styling */
/* .accepted-files ruleset removed - was empty after border removal */

.accepted-files .file-changes-title {
    color: #238636;
}

.accepted-files .change-status-icon.accepted {
    color: #238636;
}

/* Progress history content (when chat is restored) */
.progress-history-content {
    width: 100%;
}

.progress-history-content .app-features-section {
    margin-bottom: 24px;
}

.progress-history-content .code-generation-section {
    margin-top: 20px;
}

.progress-history-content .code-generation-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #fff;
}

.progress-history-content .file-preview {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-history-content .file-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
}

.progress-history-content .file-header .line-count {
    margin-left: auto;
    color: #34C759;
    font-size: 12px;
}

.file-changes-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: rgba(35, 134, 54, 0.1);
    border-radius: 6px;
    margin-top: 12px;
    color: #238636;
    font-size: 14px;
    font-weight: 500;
}

.file-changes-status .status-icon {
    width: 16px;
    height: 16px;
    color: #238636;
}

/* Build Progress Styles */
.build-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    color: white;
    padding: 30px;
    box-sizing: border-box;
    min-height: 720px;
    min-width: 380px;
}

.build-progress-content {
    text-align: center;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.build-spinner {
    width: 80px;
    height: 80px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: buildSpinner 1s linear infinite !important;
    margin: 0 auto 25px;
    flex-shrink: 0;
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}

@keyframes buildSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.build-progress h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: white;
}

.build-progress p {
    margin: 0 0 20px 0;
    opacity: 0.9;
    font-size: 0.9em;
}



/* Iframe Preview Styles */
.iframe-preview {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    position: relative;
}

.iframe-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* Fallback Preview Styles */
.fallback-preview {
    position: relative;
}

.fallback-notice {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 193, 7, 0.9);
    color: #856404;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    z-index: 10;
    backdrop-filter: blur(10px);
}

/* Preview Error Styles */
.preview-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border-radius: 20px;
    color: white;
    padding: 20px;
}

.error-content {
    text-align: center;
    max-width: 300px;
}

.error-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.error-content p {
    margin: 0 0 20px 0;
    opacity: 0.9;
    font-size: 0.9em;
}

.retry-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Enhanced Device Frame for Iframe */
.device-frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 20px;
    overflow: hidden;
}

.device-frame.iframe-mode {
    background: #000;
    padding: 0;
}

/* iOS-like Device Frame */
.device-outline {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 0 0 2px #333,
        0 0 20px rgba(0, 0, 0, 0.3);
}

.device-outline.with-iframe {
    background: #000;
    padding: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .build-progress {
        padding: 15px;
    }
    
    .build-progress-content {
        max-width: 250px;
    }
    
    .build-spinner {
        width: 50px;
        height: 50px;
        margin: 0 auto 15px;
        animation: buildSpinner 1s linear infinite !important;
        transform-origin: center center;
        will-change: transform;
        backface-visibility: hidden;
    }
    
    .build-progress h3 {
        font-size: 1.1em;
    }
}

/* Loading states */
.preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.preview-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

/* Success states */
.preview-success {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    z-index: 10;
    backdrop-filter: blur(10px);
}

/* Animation for iframe loading */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.iframe-preview iframe {
    animation: fadeIn 0.5s ease-out;
}

/* Device frame enhancements */
.device-frame.building {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.device-frame.ready {
    background: #000;
    transition: background 0.3s ease;
}

.device-frame.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.build-spinner-simple {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    flex-shrink: 0;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    transform-origin: center center;
}