/* Updated color scheme based on Market X Maker logo */
:root {
  --primary-pink: #ec4899;
  --primary-purple: #8b5cf6;
  --primary-orange: #f97316;
  --primary-yellow: #eab308;
}

/* Glass morphism effects and custom styles */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

/* NUCLEAR OPTION: Force table scrolling by targeting the exact HTML structure */
.glass-card.overflow-hidden {
  overflow: visible !important;
}

.glass-card .table-container {
  overflow-x: scroll !important;
  overflow-y: visible !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.table-container {
  overflow-x: scroll !important;
  overflow-y: visible !important;
  display: block !important;
  width: 100% !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Fix user menu dropdown visibility */
#user-menu.glass-card {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(75, 85, 99, 0.5);
  z-index: 9999;
  position: absolute;
}

/* Disabled button styling */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* User menu button styling */
#user-menu button {
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 10000;
}

#user-menu button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Ensure user menu is fully interactive */
#user-menu {
  pointer-events: auto;
}

/* Fix potential text selection issues */
#user-menu-btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.glass-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
  pointer-events: none;
}

.glass-nav {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-input {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  color: white;
  transition: all 0.3s ease;
}

.glass-input:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.glass-input::placeholder {
  color: rgba(156, 163, 175, 0.7);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-pink), var(--primary-orange));
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.btn-sm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: auto;
}

.metric-card {
  padding: 24px;
  border-radius: 12px;
  color: white;
  transition: transform 0.3s ease;
}

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

.script-card {
  padding: 20px;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.script-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.nav-link {
  color: rgba(156, 163, 175, 0.8);
  transition: all 0.3s ease;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--primary-orange);
  background: rgba(249, 115, 22, 0.1);
}

.nav-bottom-btn {
  color: rgba(156, 163, 175, 0.8);
  transition: all 0.3s ease;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
}

.nav-bottom-btn.active {
  color: var(--primary-orange);
}

.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn.active {
  color: var(--primary-orange);
  border-color: var(--primary-orange);
}

.activity-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.activity-log-item {
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.activity-log-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(236, 72, 153, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.activity-log-item:hover::before {
  opacity: 1;
}

.activity-log-item:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.2);
}

.file-item {
  transition: all 0.3s ease;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1001;
}

/* Toast Container - Ensure it appears above modals */
#toast-container {
  z-index: 10000 !important; /* Force above modals */
}

/* Toast Styles - Optimized for performance */
.toast {
  padding: 16px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideIn 0.2s ease;
  will-change: transform, opacity;
  transform: translateZ(0); /* Force hardware acceleration */
  z-index: 10000; /* Ensure toasts appear above modals */
}

.toast.success {
  background: rgba(16, 185, 129, 0.9);
}

.toast.error {
  background: rgba(239, 68, 68, 0.9);
}

.toast.warning {
  background: rgba(245, 158, 11, 0.9);
}

.toast.info {
  background: rgba(59, 130, 246, 0.9);
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes progress {
  from {
    width: 0%;
  }
}

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

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.animate-slide-down {
  animation: slideDown 0.3s ease;
}

.animate-slide-up {
  animation: slideUp 0.6s ease;
}

.animate-slide-in {
  animation: slideIn 0.5s ease;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease;
}

.animate-modal-in {
  animation: modalIn 0.3s ease;
}

.animate-progress {
  animation: progress 1s ease;
}

.animate-count-up {
  animation: countUp 0.8s ease;
}

.animate-shake {
  animation: shake 0.5s ease;
}

/* Loading animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.animate-pulse {
  animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Better glow animation for running status */
@keyframes statusGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
  }
}

.animate-status-glow {
  animation: statusGlow 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px currentColor);
  }
}

.activity-log-item:hover .icon-pulse {
  animation: iconPulse 1.5s ease-in-out infinite;
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Hover effects */
.hover\:scale-105:hover {
  transform: scale(1.05);
}

.hover\:scale-110:hover {
  transform: scale(1.1);
}

/* Focus states */
.focus\:outline-none:focus {
  outline: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.7);
}

/* Table responsiveness and mobile scrolling */
.table-container {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  width: 100% !important;
  display: block !important;
}

.table-container table {
  min-width: 800px !important;
  width: 100% !important;
  display: table !important;
}

/* Password field icon fixes */
.glass-input.pl-10 {
  padding-left: 40px;
}

.glass-input.pr-10 {
  padding-right: 40px;
}

.relative .absolute.inset-y-0.left-0.pl-3 {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 12px;
  pointer-events: none;
}

.relative .absolute.inset-y-0.right-0.pr-3 {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding-right: 12px;
  pointer-events: auto;
  cursor: pointer;
}

#toggle-password {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  min-width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Prevent button text selection */
button {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* =================================================================== */
/* MOBILE AND DESKTOP RESPONSIVE STYLES */
/* =================================================================== */

/* Desktop - ensure everything works properly */
@media (min-width: 769px) {
  body {
    height: auto;
    overflow: visible;
    position: static;
    width: auto;
  }
  
  main {
    height: auto;
    overflow: visible;
    padding-bottom: 0;
  }
  
  button, input, select, textarea, a {
    pointer-events: auto;
    cursor: pointer;
  }
  
  .glass-input {
    cursor: text;
  }
  
  .table-container {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    width: 100% !important;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  #main-content {
    padding: 1.5rem 0.5rem;
    padding-bottom: 120px;
  }

  .metric-card {
    padding: 12px;
    margin: 0;
  }

  .script-card {
    padding: 12px;
    margin: 0;
  }

  .modal-content {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
  
  .glass-input {
    font-size: 16px;
    -webkit-appearance: none;
  }
  
  .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .btn-sm span {
    display: none;
  }
  
  .btn-sm i {
    margin-right: 0 !important;
  }
  
  .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 -1rem !important;
    padding: 0 1rem !important;
    display: block !important;
    width: 100% !important;
  }
}

/* =================================================================== */
/* LOGIN PAGE SPECIFIC STYLES - ONLY for login-page class */
/* =================================================================== */

/* Desktop login page - ensure everything works properly */
@media (min-width: 769px) {
  body.login-page {
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    width: auto !important;
  }
  
  body.login-page input[type="text"], 
  body.login-page input[type="password"],
  body.login-page button {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: auto !important;
  }
  
  body.login-page .glass-input {
    cursor: text !important;
  }
  
  body.login-page .glass-card {
    position: relative !important;
    z-index: auto !important;
  }
  
  body.login-page .absolute.inset-y-0 {
    position: absolute !important;
    display: flex !important;
    align-items: center !important;
    z-index: auto !important;
  }
}

/* Mobile login page fixes - ONLY for login page */
@media (max-width: 768px) {
  body.login-page {
    height: 100vh !important;
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    background: linear-gradient(135deg, #111827, #000000, #581c87) !important;
  }
  
  body.login-page * {
    background-color: transparent !important;
  }
  
  body.login-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #111827, #000000, #581c87) !important;
    z-index: -1;
  }
  
  body.login-page .min-h-screen {
    height: 100vh !important;
    overflow: hidden !important;
  }
  
  body.login-page input[type="text"], 
  body.login-page input[type="password"],
  body.login-page button {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
    touch-action: manipulation !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
  }
  
  body.login-page .glass-card {
    position: relative !important;
    z-index: 20 !important;
  }
  
  body.login-page .absolute.inset-y-0 {
    position: absolute !important;
    display: flex !important;
    align-items: center !important;
    z-index: 22 !important;
  }
}

/* =================================================================== */
/* DASHBOARD MOBILE STYLES - for all pages EXCEPT login */
/* =================================================================== */

@media (max-width: 768px) {
  /* Dashboard mobile layout - NOT login page */
  body:not(.login-page) {
    height: 100vh;
    overflow: hidden;
  }
  
  body:not(.login-page) main {
    height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 120px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  
  body:not(.login-page) main::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
  
  body:not(.login-page) main > div {
    padding: 1.5rem 0.5rem !important;
    padding-bottom: 20px !important;
  }
  
  /* Dashboard mobile interactions */
  body:not(.login-page) button, 
  body:not(.login-page) input, 
  body:not(.login-page) select, 
  body:not(.login-page) textarea, 
  body:not(.login-page) a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
  }
  
  /* Dashboard table scrolling for mobile */
  body:not(.login-page) .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }
  
  /* Near edge-to-edge mobile layout with subtle padding */
  .glass-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 6px !important;
  }
  
  /* Mobile table improvements - edge to edge */
  .table-container {
    margin: 0 !important;
    padding: 0 1rem !important;
  }
  
  /* Ensure bottom navigation doesn't block content */
  body:not(.login-page) {
    padding-bottom: 0 !important;
  }
  
  /* Fix scripts page header layout on mobile */
  .flex.justify-between.items-center {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .flex.justify-between.items-center > div:last-child {
    width: 100%;
    justify-content: flex-start;
  }
  
  #connection-status {
    font-size: 0.75rem;
    padding: 0.5rem;
  }
  
  #connection-status span {
    display: none;
  }
  
  #refresh-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  /* Dashboard mobile optimizations */
  .metric-card {
    padding: 1rem !important;
    min-height: 120px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .metric-card p:first-child {
    font-size: 0.75rem !important;
  }
  
  .metric-card p:nth-child(2) {
    font-size: 1.5rem !important;
  }
  
  .metric-card i {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
  
  /* Tab styling for mobile */
  .tab-btn {
    background: transparent;
    color: rgba(156, 163, 175, 0.8);
  }
  
  .tab-btn.active {
    background: rgba(249, 115, 22, 0.2);
    color: var(--primary-orange);
  }
  
  /* Mobile dashboard content */
  .dashboard-content-container {
    height: calc(100vh - 420px);
    min-height: 400px;
  }
  
  .content-grid {
    height: 100%;
  }
  
  .content-grid > div {
    height: 100%;
  }
  
  /* Make cards 2x2 grid on mobile */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    margin: 0 0 1.5rem 0 !important;
  }
  
  /* Add padding to non-card content */
  .dashboard-content-container,
  h1, h2, p:not(.metric-card p) {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Hide scrollbars in dashboard content areas */
  #running-scripts-container,
  #recent-activity-container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  
  #running-scripts-container::-webkit-scrollbar,
  #recent-activity-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
  
  /* File Browser Styles */
  #context-menu {
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.5);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .context-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    color: #e5e7eb;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
  }

  .context-menu-item:hover {
    background-color: rgba(249, 115, 22, 0.15);
    color: #fbbf24;
  }

  .context-menu-item.text-red-400:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
  }

  .context-menu-item i {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .file-item {
    position: relative;
    user-select: none;
  }

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

  /* Upload drop zone styles */
  #drop-zone.border-orange-400 {
    border-color: #fb923c !important;
    background-color: rgba(251, 146, 60, 0.1);
  }

  /* Monaco editor modal styles */
  #file-editor-modal .modal-content {
    width: 95vw;
    max-width: 1200px;
    height: 80vh;
    max-height: none;
    border-radius: 12px;
    overflow: hidden;
  }

  #file-editor-modal .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
  }

  #monaco-editor {
    border-radius: 0 0 12px 12px;
    overflow: hidden;
  }

  /* Mobile responsive file browser */
  @media (max-width: 768px) {
    .file-grid {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 12px !important;
    }
    
    .file-item .text-sm {
      font-size: 0.75rem;
    }
    
    /* Mobile Editor Modal - Full Screen Experience */
    #file-editor-modal {
      padding: 0 !important;
    }
    
    #file-editor-modal .modal-overlay {
      background: rgba(0, 0, 0, 0.95);
    }
    
    #file-editor-modal .modal-content {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      width: 100vw !important;
      height: 100vh !important;
      max-width: none !important;
      max-height: none !important;
      margin: 0 !important;
      border-radius: 0 !important;
      transform: none !important;
    }
    
    #file-editor-modal .modal-header {
      padding: 12px 16px;
      min-height: 60px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }
    
    #file-editor-modal .modal-header h2 {
      font-size: 1rem;
      margin: 0;
      flex: 1;
      min-width: 120px;
    }
    
    #file-editor-modal .modal-header .flex.space-x-2 {
      display: flex;
      gap: 6px;
    }
    
    #file-editor-modal .btn-sm {
      padding: 6px 10px !important;
      font-size: 0.8rem !important;
      min-width: auto;
    }
    
    #file-editor-modal .btn-sm i {
      width: 14px !important;
      height: 14px !important;
    }
    
    #monaco-editor {
      height: calc(100vh - 60px) !important;
      border-radius: 0 !important;
    }
    
    .context-menu-item {
      padding: 14px 18px;
      font-size: 1rem;
      min-height: 48px;
    }
    
    .context-menu-item i {
      width: 20px;
      height: 20px;
      margin-right: 12px;
    }
    
    #context-menu {
      min-width: 200px;
      border-radius: 12px;
    }
    
    /* Touch-friendly scrollbars for mobile editor */
    #monaco-editor .monaco-scrollable-element .scrollbar {
      background: rgba(255, 255, 255, 0.1) !important;
    }
    
    #monaco-editor .monaco-scrollable-element .slider {
      background: rgba(249, 115, 22, 0.6) !important;
    }
    
    #monaco-editor .monaco-scrollable-element .slider:hover {
      background: rgba(249, 115, 22, 0.8) !important;
    }
  }

  /* Desktop improvements */
  @media (min-width: 769px) {
    #context-menu {
      min-width: 180px;
    }
    
    #file-editor-modal .modal-content {
      height: 85vh;
      max-height: 700px;
    }
    
    #monaco-editor {
      height: calc(85vh - 80px);
      max-height: 620px;
    }
  }

  /* File type colors and icons */
  .file-type-python { color: #3776ab; }
  .file-type-javascript { color: #f7df1e; }
  .file-type-html { color: #e34f26; }
  .file-type-css { color: #1572b6; }
  .file-type-json { color: #000000; }
  .file-type-markdown { color: #083fa1; }

  /* Progress bar animation */
  #upload-bar {
    transition: width 0.3s ease-in-out;
  }

  /* Breadcrumb improvements */
  #breadcrumb button:hover {
    text-decoration: underline;
  }

  /* Mobile modal improvements (logs and config) */
  .modal-content.max-w-4xl {
    position: fixed !important;
    top: 64px !important; /* Below header nav */
    bottom: 80px !important; /* Above bottom nav */
    left: 0.5rem !important;
    right: 0.5rem !important;
    width: calc(100vw - 1rem) !important;
    height: calc(100vh - 144px) !important; /* 64px top nav + 80px bottom nav */
    max-height: calc(100vh - 144px) !important;
    max-width: calc(100vw - 1rem) !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
  }
  
  #modal-logs-container {
    flex: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  
  /* Mobile close button repositioning */
  .modal-content .flex.justify-between.items-center:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
    order: 2 !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }
  
  .modal-content .flex.justify-between.items-center:first-child h2 {
    order: -1 !important;
    text-align: center !important;
    margin-bottom: 1rem !important;
    color: white !important;
  }
  
  .modal-content .flex.justify-between.items-center:first-child button {
    width: 100% !important;
    justify-content: center !important;
    padding: 1rem !important;
    background: rgba(239, 68, 68, 0.3) !important;
    border: 2px solid rgba(239, 68, 68, 0.8) !important;
    border-radius: 0.5rem !important;
    color: white !important;
    font-weight: bold !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
  }
  
  .modal-content .flex.justify-between.items-center:first-child button i {
    color: white !important;
    margin-right: 0.5rem !important;
  }
}