/* ============================================
   GOOGLE DRIVE-LIKE SPLIT LAYOUT
   ============================================ */

/* Main container using Flexbox */
.split-container {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}

.split-container * {
  box-sizing: border-box;
}

/* Main section - takes remaining space */
.main-section {
  flex: 1;
  height: 100%;
  position: relative;
  background: #ffffff;
  /* width is handled by flex: 1 */
  min-width: 0;
  /* Allows shrinking below content size if needed */
  transition: all 0.3s ease;
}

/* Right sidebar - 25% width with constraints */
.right-sidebar {
  position: relative;
  width: 15%;
  min-width: 300px;
  max-width: 500px;
  height: 100%;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  border-left: 1px solid #d1d9e6;
  /* Thinner border */
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
  /* Stronger shadow for better separation */
  display: flex;
  flex-direction: column;
  z-index: 100;
  /* Animate width and min-width for smooth open/close */
  transition: width 0.3s ease, min-width 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
  /* Prevent sidebar from shrinking below defined width unless explicitly changed */
}

/* Sidebar closed state */
.split-container.sidebar-closed .right-sidebar {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border-left-width: 0;
  /* Hide border when closed */
}

/* Sidebar header */
.sidebar-header {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
  color: rgb(0, 0, 0);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0px;
  color: #333;
}

.sidebar-header .icon {
  font-size: 20px;
  color: white;
}

/* Sidebar content - scrollable */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
}

/* Custom scrollbar for sidebar */
.sidebar-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Sidebar close button */
.sidebar-close-btn {
  background: transparent;
  border: none;
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 20px;
}

.sidebar-close-btn i {
  color: #000 !important;
}

.sidebar-close-btn:hover {
  background: transparent;
  transform: scale(1.1);
}

/* Sidebar toggle button - appears when sidebar is closed */
.sidebar-toggle-btn {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: #e0e1e2;
  color: #04a6c0;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
}

.split-container.sidebar-closed .sidebar-toggle-btn {
  opacity: 1;
  pointer-events: all;
}

.sidebar-toggle-btn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.sidebar-toggle-btn i {
  font-size: 20px;
}

/* Sample content styling for sidebar */
.sidebar-section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.sidebar-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.sidebar-section h4 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section p {
  margin: 0;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.sidebar-section .icon {
  color: #64c47d;
  font-size: 18px;
}

/* Info item styling - ENHANCED VISIBILITY */
.info-item {
  margin-bottom: 16px;
  /* padding-bottom: 16px; */
  border-bottom: 1px solid #e8ecf1;
}

.info-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.info-item label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #333;
  /* Indigo 600 - High contrast */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.info-item .info-value {
  font-size: 15px;
  color: #000000;
  /* Black - High contrast */
  font-weight: 500;
}

/* Responsive design */
@media (max-width: 1200px) {
  .right-sidebar {
    width: 30%;
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  .split-container {
    display: block;
    /* Stack on mobile or keep relative logic */
  }

  .right-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    z-index: 1000;
    transform: translateX(0);
  }

  .split-container.sidebar-closed .right-sidebar {
    width: 100%;
    min-width: 100%;
    transform: translateX(100%);
    /* Slide out on mobile */
    opacity: 0;
  }

  .main-section {
    width: 100%;
  }

  .split-container.sidebar-closed .sidebar-toggle-btn {
    right: 10px;
    width: 40px;
    height: 40px;
  }
}

/* Ensure canvas and other absolute positioned elements work correctly */
.main-section #MainDiv {
  width: 100%;
  height: 100%;
}

.main-section #viewcanvas {
  width: 100% !important;
  height: 100% !important;
}

/* Animation for smooth transitions */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}