/* Premium Minimalist Dark Theme - Cloud Console style */
body {
  background-color: #0c0c0d;
  color: #e3e3e6;
  font-family: Georgia, serif;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Top Navigation Bar */
.console-navbar {
  height: 70px;
  background-color: #121214;
  border-bottom: 1px solid #2d2d30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.site-title {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin: 0;
}

.site-subtitle {
  font-size: 11px;
  color: #8a8a93;
  font-style: italic;
}

/* Navbar User Panel Area */
.navbar-user-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Guest Forms inside Navbar */
.nav-auth-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-tab-toggle {
  font-size: 12.5px;
  display: flex;
  gap: 10px;
}

.nav-input {
  background-color: #0c0c0d;
  border: 1px solid #2d2d30;
  color: #ffffff;
  padding: 5px 10px;
  font-family: Georgia, serif;
  font-size: 11.5px;
  width: 120px;
  outline: none;
}

.nav-input:focus {
  border-color: #ffffff;
}

/* User Profile & Quota inside Navbar */
.nav-user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-quota-container {
  display: flex;
  flex-direction: column;
  width: 160px;
}

.nav-quota-bar {
  height: 5px;
  background-color: #0c0c0d;
  border: 1px solid #2d2d30;
  position: relative;
  margin-top: 3px;
}

.nav-quota-progress {
  width: 0%;
  height: 100%;
  background-color: #00ff00;
  transition: width 0.3s;
}

/* Main Container below Navbar */
.console-main-container {
  display: flex;
  flex: 1;
  width: 100%;
  overflow: hidden;
}

/* Left Control Sidebar */
.console-sidebar {
  width: 320px;
  background-color: #121214;
  border-right: 1px solid #2d2d30;
  display: flex;
  flex-direction: column;
  padding: 24px;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow-y: auto;
  height: 100%;
}

.section-title {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a8a93;
  margin-bottom: 12px;
  border-bottom: 1px solid #2d2d30;
  padding-bottom: 6px;
}

.section-title:not(:first-of-type) {
  margin-top: 24px;
}

/* Instance Selector List */
.instance-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.instance-option {
  background-color: #18181c;
  border: 1px solid #2d2d30;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.instance-option:hover {
  border-color: #ffffff;
}

.instance-option.active {
  border-color: #ffffff;
  background-color: #1e1e24;
}

.instance-name {
  font-size: 13.5px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 2px;
}

.instance-status {
  font-family: "Courier New", monospace;
  font-size: 9.5px;
  font-weight: bold;
}

.status-online {
  color: #00ff00;
}

.status-offline {
  color: #8a8a93;
}

/* Actions Panel */
.action-panel {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-boot {
  display: block;
  width: 100%;
  background-color: transparent;
  color: #ffffff;
  border: 1.5px solid #ffffff;
  padding: 8px;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: all 0.2s;
  box-sizing: border-box;
}

.btn-boot:hover {
  background-color: #ffffff;
  color: #000000;
}

.btn-boot:disabled {
  color: #8a8a93 !important;
  border-color: #8a8a93 !important;
  cursor: not-allowed;
  background-color: transparent !important;
}

/* Right Main Console Viewport */
.console-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #000000;
}

.screen-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.screen-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  image-rendering: auto !important; /* High-quality smooth scaling */
}

/* Clean Footer Status bar */
.emulator-footer {
  background-color: #121214;
  color: #e3e3e6;
  border-top: 1px solid #2d2d30;
  font-family: Georgia, serif;
  font-size: 11px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.footer-right {
  margin-left: auto;
  display: flex;
  gap: 15px;
  align-items: center;
}

.btn-action {
  background-color: transparent;
  color: #ffffff;
  border: 1.5px solid #ffffff;
  padding: 4px 12px;
  cursor: pointer;
  font-weight: bold;
  font-size: 10px;
  font-family: Georgia, serif;
  transition: all 0.2s;
}

.btn-action:hover {
  background-color: #ffffff;
  color: #000000;
}

/* Staging Banner */
.staging-screen {
  color: #c4c4c9;
  font-family: Georgia, serif;
  text-align: center;
  padding: 40px;
}

/* Fullscreen canvas styling */
#screen_container:fullscreen {
  background-color: #000000 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#screen_container:fullscreen canvas {
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 900px) {
  body {
    overflow-y: auto;
    height: auto;
  }

  .console-navbar {
    height: auto;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
  }

  .navbar-user-section {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .nav-auth-form {
    flex-direction: column;
    width: 100%;
  }

  .nav-input {
    width: 100%;
    box-sizing: border-box;
  }

  .console-main-container {
    flex-direction: column-reverse;
    height: auto;
    overflow: visible;
  }

  .console-sidebar {
    width: 100%;
    border-right: none;
    border-top: 1px solid #2d2d30;
    height: auto;
    padding: 24px;
    overflow: visible;
  }

  .action-panel {
    margin-top: 25px;
  }

  .console-viewport {
    width: 100%;
    height: auto;
    border-bottom: 1px solid #2d2d30;
  }

  .screen-wrapper {
    width: 100%;
    min-height: 320px;
    height: 55vh;
  }
}

/* Profile Modal styling */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
.modal-box {
  background-color: rgba(18, 18, 20, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 420px;
  max-width: 90%;
  padding: 24px;
  box-sizing: border-box;
  font-family: Georgia, serif;
  color: #e3e3e6;
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
  border-radius: 8px;
}
.modal-header {
  font-size: 18px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: #8a8a93;
  font-size: 20px;
  cursor: pointer;
}
.modal-close-btn:hover {
  color: #ffffff;
}
.modal-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #2d2d30;
  font-size: 13px;
}

/* Toast Notifications styling */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
  pointer-events: none;
}

.toast-message {
  background-color: rgba(18, 18, 20, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1.5px solid rgba(255, 76, 76, 0.4); /* Default border red for error */
  color: #e3e3e6;
  padding: 12px 20px;
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 12.5px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-width: 280px;
  max-width: 400px;
  animation: slideInToast 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: all 0.3s;
}

.toast-message.success {
  border-color: rgba(0, 255, 0, 0.4);
}

.toast-message.info {
  border-color: rgba(0, 170, 255, 0.4);
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: #8a8a93;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.toast-close-btn:hover {
  color: #ffffff;
}

@keyframes slideInToast {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* Premium Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(18, 18, 20, 0.75);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 24px;
  width: 90%;
  max-width: 650px;
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.6);
  animation: slideUpCookie 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner p {
  margin: 0;
  color: #a9a9b3;
  font-family: Georgia, serif;
  font-size: 11.5px;
  line-height: 1.5;
  flex: 1;
  text-align: left;
}

@keyframes slideUpCookie {
  from {
    transform: translate(-50%, 150%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* Glowing green dot pulse animation */
@keyframes pulse {
  0% {
    opacity: 0.3;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
  }
  100% {
    opacity: 0.3;
    transform: scale(0.9);
  }
}
