/* SamCloud - Complete UI Replacement using CSS Overlay */
:root {
  --samcloud-blue: #4A90E2 !important;
  --samcloud-light-blue: #74A9F0 !important;
  --samcloud-bg: #f5f7fa !important;
  --samcloud-white: #ffffff !important;
  --samcloud-text: #1a1a1a !important;
  --samcloud-gray: #8e8e93 !important;
  --samcloud-border: rgba(74, 144, 226, 0.1) !important;
}

/* Hide the entire FileBrowser UI */
body > #app,
body > .app,
body > main,
body > .main,
body > div:not(.samcloud-overlay) {
  display: none !important;
}

/* Create our overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--samcloud-bg);
  z-index: 9999;
  display: block !important;
}

/* Inject our complete custom UI */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif !important;
  background: var(--samcloud-bg) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Create the UI structure with CSS */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: grid;
  grid-template-areas: 
    "header header header"
    "sidebar main preview";
  grid-template-columns: 260px 1fr 320px;
  grid-template-rows: 70px 1fr;
  gap: 20px;
  padding: 20px;
  background: var(--samcloud-bg);
}

/* Header */
body::before {
  background-image: 
    /* Header */
    linear-gradient(to right, var(--samcloud-white), var(--samcloud-white)),
    /* Sidebar */
    linear-gradient(to bottom, rgba(255,255,255,0.7), rgba(255,255,255,0.7)),
    /* Main content */
    linear-gradient(to bottom, var(--samcloud-white), var(--samcloud-white)),
    /* Preview */
    linear-gradient(to bottom, var(--samcloud-white), var(--samcloud-white));
  
  background-size:
    calc(100vw - 40px) 70px,
    260px calc(100vh - 110px),
    calc(100vw - 620px) calc(100vh - 110px),
    320px calc(100vh - 110px);
    
  background-position:
    20px 20px,
    20px 110px,
    300px 110px,
    calc(100vw - 340px) 110px;
    
  background-repeat: no-repeat;
}
