/* Top Bar Styles - matching footer theme */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to right, #4C8CFE 0%, #4C8CFE 15px, #303030 15px, #303030 100%);
  color: #fff;
  display: flex;
  align-items: center;
  z-index: 2002;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  margin: 0;
  padding: 0;
}

.top-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 20px;
  gap: 20px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.top-bar-icon:hover {
  transform: scale(1.1);
}

.top-bar-center {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.top-bar-menu {
  position: relative;
  display: inline-block;
  z-index: 9999;
}

.file-menu-button {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: background-color 0.2s ease;
}

.file-menu-button:hover,
.file-menu-button.active {
  background-color: rgba(76, 140, 254, 0.2);
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.file-menu-button.active .dropdown-arrow {
  transform: rotate(180deg);
}

.file-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #303030;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.file-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 8px 16px;
  color: #E8F2FF;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: sans-serif;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.dropdown-item:hover {
  background-color: rgba(76, 140, 254, 0.2);
}

.dropdown-item:first-child {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

.dropdown-item:last-child {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-bar-title {
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #E8F2FF;
  margin: 0;
  white-space: nowrap;
}

/* Updated control buttons for top bar */
.top-bar-button {
  padding: 6px 12px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #E8F2FF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  height: 28px;
  max-height: 28px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.top-bar-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.top-bar-button.logout-button {
  background-color: rgba(220, 53, 69, 0.8);
  border-color: rgba(220, 53, 69, 0.6);
}

.top-bar-button.logout-button:hover {
  background-color: rgba(220, 53, 69, 0.9);
  border-color: rgba(220, 53, 69, 0.8);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}



#newDesignButton {
  background-color: rgba(40, 167, 69, 0.8);
  border-color: rgba(40, 167, 69, 0.6);
}

#newDesignButton:hover {
  background-color: rgba(40, 167, 69, 0.9);
  border-color: rgba(40, 167, 69, 0.8);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

#newDesignButton svg {
  margin-right: 6px;
  transition: transform 0.2s ease;
}

.top-bar-button.login-button {
  background-color: rgba(76, 140, 254, 0.8);
  border-color: rgba(76, 140, 254, 0.6);
}

.top-bar-button.login-button:hover {
  background-color: rgba(76, 140, 254, 0.9);
  border-color: rgba(76, 140, 254, 0.8);
  box-shadow: 0 2px 8px rgba(76, 140, 254, 0.3);
}

.login-button svg {
  margin-right: 6px;
  transition: transform 0.2s ease;
}

.logout-button svg {
  transition: transform 0.2s ease;
}

.logout-button:hover svg {
  transform: scale(1.1);
}

.button-icon {
  transition: transform 0.2s ease;
  margin-right: 2px;
}

.file-menu-button:hover .button-icon {
  transform: scale(1.1);
}

.dropdown-icon {
  transition: transform 0.2s ease;
  min-width: 12px;
  flex-shrink: 0;
}

.dropdown-item:hover .dropdown-icon {
  transform: scale(1.1);
}

/* Adjust main app to account for top bar */
#main-app {
  padding-top: 40px;
}

/* Responsive top bar */
@media (max-width: 900px) {
  .top-bar {
    height: auto;
    min-height: 40px;
    padding: 6px 0;
  }
  
  .top-bar-content {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 15px;
  }
  
  .top-bar-title {
    font-size: 12px;
  }
  
  .top-bar-button {
    font-size: 11px;
    padding: 5px 10px;
  }
  
  #main-app {
    padding-top: 50px;
  }
}

.container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: lightblue;
  border: 0px solid black;
  z-index: 2000
}

.globals-list {
  max-height: calc(100vh - 90px);
  position: absolute;
  margin: 5px;
  margin-top: 50px;
  padding: 5px;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.globals-list.collapsed {
  transform: translateX(-200px);
}

.global-values {
  display: none;
  background-color: #69aec9;
  border-radius: 10px;
  position: relative;
  top: 0;
  left: 0;
  border-collapse: collapse;

  font-size: 12px;
  font-family: sans-serif;
  min-width: 200px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  margin-bottom: 5px;
}

.global-values td {
  font-family: sans-serif;
  font-weight: normal;
  font-style: normal;
  padding: 3px 9px;
  border-radius: 10px;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #f0f0f0;
  width: 100vw;
  height: 100vh;
}

footer {
  text-align: left;
  background: linear-gradient(to right, #4C8CFE 0%, #4C8CFE 15px, #303030 15px, #303030 100%);
  color: #fff;
  padding: 0;
  position: absolute;
  bottom: 0;
  width: 100%;
  margin: 0;
  height: 40px;
  display: flex;
  align-items: center;
  border-radius: 0;
  opacity: 1;
  z-index: 2001;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  font-family: sans-serif;
}

footer .footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 20px;
  gap: 20px;
}

footer .footer-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

footer .footer-center {
  display: flex;
  align-items: center;
  gap: 25px;
  flex: 1;
  justify-content: center;
}

footer .footer-right {
  display: flex;
  align-items: center;
  gap: 15px;
  white-space: nowrap;
}

footer .footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

footer .footer-version {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: sans-serif;
}

footer p {
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-family: sans-serif;
  line-height: 1.4;
}

footer p a {
  color: #E8F2FF !important;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
  font-family: sans-serif;
}

footer p a:visited {
  color: #E8F2FF !important;
}

footer p a:hover {
  color: #4C8CFE !important;
  border-bottom-color: #4C8CFE;
  text-shadow: 0 0 8px rgba(76, 140, 254, 0.3);
}

footer p a:active {
  color: #4C8CFE !important;
}

footer .footer-brand a {
  color: #E8F2FF !important;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: sans-serif;
}

footer .footer-brand a:visited {
  color: #E8F2FF !important;
}

footer .footer-brand a:hover {
  color: #4C8CFE !important;
}

footer .footer-brand a:active {
  color: #4C8CFE !important;
}

footer img {
  width: 118px;
  height: 20px;
  transition: transform 0.2s ease;
}

footer img:hover {
  transform: scale(1.05);
}

footer .footer-links {
  display: flex;
  align-items: center;
  gap: 15px;
}

footer .footer-links a {
  color: #E8F2FF !important;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: sans-serif;
}

footer .footer-links a:visited {
  color: #E8F2FF !important;
}

footer .footer-links a:hover {
  color: #4C8CFE !important;
  background: rgba(76, 140, 254, 0.15);
  transform: translateY(-1px);
}

footer .footer-links a:active {
  color: #4C8CFE !important;
}

footer .footer-contact {
  font-size: 12px;
  opacity: 0.9;
  font-family: sans-serif;
}

/* Responsive footer */
@media (max-width: 1200px) {
  footer .footer-center {
    gap: 15px;
  }
  
  footer .footer-links {
    gap: 10px;
  }
}

@media (max-width: 900px) {
  footer {
    height: auto;
    min-height: 40px;
    padding: 6px 0;
  }
  
  footer .footer-content {
    flex-direction: column;
    gap: 6px;
    padding: 0 15px;
  }
  
  footer .footer-center {
    flex-direction: column;
    gap: 6px;
  }
  
  footer .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
}

.swal2-container {
  z-index: 10001;
  font-family: sans-serif;
}

.swal2-popup {
  width: 30em;
  padding: 0 0 0.5em;
  border-radius: 30px;
}

.swal2-input {
  width: 225px;
  height: 2.2em;
  padding: 0.5em;
  margin: 1px;
}

.file-input-style {
  width: 300px;
  text-align: center;
  margin-right: auto;
  margin-left: auto;
  margin-top: 20px;
}

.ctxmenu {
  font-family: sans-serif;
  border-radius: 5px;
  font-size: 16px;
  padding: 6px;
}

.tippy-content {
  font-family: sans-serif;
  font-size: 16px;
}

/* Login Styles */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #4C8CFE 0%, #69aec9 50%, #4C8CFE 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.login-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-header {
  margin-bottom: 2rem;
}

.login-logo {
  width: 150px;
  height: auto;
  margin-bottom: 1rem;
  filter: brightness(0.8);
}

.login-header h2 {
  color: #303030;
  margin: 0.5rem 0;
  font-family: sans-serif;
  font-weight: 600;
  font-size: 1.8rem;
}

.login-header p {
  color: #666;
  margin: 0;
  font-family: sans-serif;
  font-size: 1rem;
}

.login-form {
  text-align: left;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #303030;
  font-family: sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-family: sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #4C8CFE;
  box-shadow: 0 0 0 3px rgba(76, 140, 254, 0.1);
}

.login-button {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, #4C8CFE 0%, #69aec9 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  /* margin-top: 1rem; */
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(76, 140, 254, 0.3);
}

.login-button:active {
  transform: translateY(0);
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-error {
  background-color: #fee;
  color: #c33;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid #fcc;
  margin-top: 1rem;
  font-family: sans-serif;
  font-size: 0.9rem;
  text-align: center;
}

/* Loading state for login button */
.login-button.loading {
  opacity: 0.7;
  pointer-events: none;
}

.login-button.loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
  margin-left: 8px;
}

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

/* ============================================
   CONTEXT MENU STYLES - Visual Only, No Layout
   ============================================ */

/* Main context menu - only visual properties */
.ctxmenu {
  background: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 14px !important;
}

/* All menu items - only visual properties */
.ctxmenu li {
  background: transparent !important;
  color: #333333 !important;
  font-weight: 500 !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}

/* Hover states */
.ctxmenu li:hover {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%) !important;
  color: #007bff !important;
}

.ctxmenu li.interactive:hover {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%) !important;
  color: #007bff !important;
}

/* Disabled items */
.ctxmenu li.disabled {
  color: #9e9e9e !important;
  background: transparent !important;
}

.ctxmenu li.disabled:hover {
  background: transparent !important;
  color: #9e9e9e !important;
}

/* Dividers */
.ctxmenu li.divider {
  background: linear-gradient(90deg, transparent 0%, #e0e0e0 20%, #e0e0e0 80%, transparent 100%) !important;
  height: 1px !important;
}

/* Action-based colors */
.ctxmenu li[data-action*="delete"],
.ctxmenu li[data-action*="remove"] {
  color: #dc3545 !important;
}

.ctxmenu li[data-action*="delete"]:hover,
.ctxmenu li[data-action*="remove"]:hover {
  background: linear-gradient(135deg, #fff8f8 0%, #ffe8e8 100%) !important;
  color: #dc3545 !important;
}

.ctxmenu li[data-action*="add"],
.ctxmenu li[data-action*="create"], 
.ctxmenu li[data-action*="connect"] {
  color: #28a745 !important;
}

.ctxmenu li[data-action*="add"]:hover,
.ctxmenu li[data-action*="create"]:hover,
.ctxmenu li[data-action*="connect"]:hover {
  background: linear-gradient(135deg, #f8fff8 0%, #e8ffe8 100%) !important;
  color: #28a745 !important;
}

.ctxmenu li[data-action*="change"],
.ctxmenu li[data-action*="edit"],
.ctxmenu li[data-action*="modify"] {
  color: #ffc107 !important;
}

.ctxmenu li[data-action*="change"]:hover,
.ctxmenu li[data-action*="edit"]:hover,
.ctxmenu li[data-action*="modify"]:hover {
  background: linear-gradient(135deg, #fffef8 0%, #fff8e8 100%) !important;
  color: #ffc107 !important;
}

/* Dark theme support (if needed) */
@media (prefers-color-scheme: dark) {
  .ctxmenu,
  .ctxmenu ul {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
  }
  
  .ctxmenu li {
    color: #ffffff;
  }
  
  .ctxmenu li:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #404040 100%);
    color: #4dabf7;
  }
  
  .ctxmenu li.divider {
    background: linear-gradient(90deg, transparent 0%, #404040 20%, #404040 80%, transparent 100%);
  }
}