/* Login Page Styles */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
}

.login-page .login-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 2.5rem;
  border-radius: 1rem;
  /*box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);*/
  text-align: center;
  min-width: 400px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-page .login-logo {
  height: 80px;
  margin-bottom: 1.5rem;
}

.login-page .login-title {
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  font-weight: 600;
}

.login-page .login-subtitle {
  color: #7f8c8d;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.login-page .login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-page .login-form input {
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.login-page .login-form input:focus {
  outline: none;
  border-color: #667eea;
  /*box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);*/
}

.login-page .login-button {
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-page .login-button:hover {
  transform: translateY(-2px);
  /*box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);*/
}

.login-page .login-error {
  color: #e74c3c;
  margin-top: 1rem;
  font-size: 0.9rem;
  display: none;
}

.login-page .forgot-password {
  color: #667eea;
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 1.5rem;
  display: inline-block;
}

.login-page .forgot-password:hover {
  text-decoration: underline;
}

/* Main Application Styles */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  min-height: 100vh;
}

/* Sidebar styles */
.sidebar {
  width: 250px;
  background: #ffffff;
  color: #333333;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  border-right: 1px solid #e0e0e0;
}

.sidebar-header {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.sidebar-logo {
  height: 60px;
  margin-bottom: 10px;
  /* Remove the invert filter to show original logo colors */
}

.sidebar-title {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  color: #2c3e50;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-main {
  flex: 1;
}

.nav-bottom {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.nav-item {
  display: block;
  padding: 15px 25px;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  color: #555555;
  border-radius: 0 25px 25px 0;
  margin: 2px 0;
  margin-right: 10px;
}

.nav-item:hover {
  background-color: #f0f0f0;
  color: #333333;
  transform: translateX(5px);
}

.nav-item.active {
  background-color: #FF4041;
  color: white;
  border-left: 4px solid #FF4041;
  /* box-shadow: 0 2px 8px rgba(255, 64, 65, 0.3); */
}

.nav-item i {
  font-style: normal;
  margin-right: 10px;
  width: 16px;
}

/* Main content area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

table {
  margin: 0 5px;
}

td,
th {
  border: 1px solid #aaa;
  padding: 10px;
}

th {
  background: #ddd;
}

thead {
  position: sticky;
  top: 0;
}

progress {
  width: 40%;
}

.main-content span {
  font-size: small;
  font-style: italic;
}

button {
  margin: 0 3px;
}

input[type=number] {
  width: 75px;
}

input[type=color] {
  margin: 0 5px;
  width: 25px;
  height: 25px;
}

select {
  width: 90px;
}

fieldset {
  legend {
    font-size: small;
    font-style: italic;
  }
}

fieldset ul {
  padding-left: 20px;
  margin: 0;
}

#fileinput {
  border: 1px dotted gray;
}

#about {
  font-size: small;
  font-style: italic;
}

#layersdetails {
  max-height: 500px;
  overflow: auto;
  background-color: #E8E8E8;
}

.toolFeatures {
  margin: 0 5px;
}

.ctrl-range {
  width: 100px;
  margin: 0px 10px;
}

/* special dwv */
#dwv {
  display: flex;
  flex: 1;
  background: black;
  border-radius: 0.5rem;
}

.layerGroup {
  flex: 1 1;
  margin: 5px 0;
  background-color: rgb(1, 8, 1);
  /* allow child centering */
  position: relative;
  border-radius: 0.5rem 0rem 0rem 0.5rem;
  overflow: hidden;
}

.layer {
  /* needed for overlay */
  position: absolute;
  /* center */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.vertical-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  margin: 5px 5px 5px 0;
  width: 10px;
  border-radius: 0rem 0.5rem 0.5rem 0rem;
  -webkit-appearance: none;
}

/** slider vertical settings*/
input.vertical-slider[type=range]::-webkit-slider-runnable-track {
  width: 10px;
  cursor: pointer;
  background: lightgray;
  border: 0;
}

input.vertical-slider[type=range]::-webkit-slider-thumb {
  width: 10px;
  height: 15px;
  background: #2F3C4A;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: 0px;
  border: 0;
}

input.vertical-slider[type=range]:disabled::-webkit-slider-thumb {
  background: lightgray;
}

input.vertical-slider[type=range]:focus::-webkit-slider-runnable-track {
  background: lightgray;
}

input.vertical-slider[type=range]::-moz-range-track {
  width: 10px;
  cursor: pointer;
  background: lightgray;
  border: 0;
}

input.vertical-slider[type=range]::-moz-range-thumb {
  width: 10px;
  height: 15px;
  background: #2F3C4A;
  cursor: pointer;
  border: 0;
}

input.vertical-slider[type=range]:disabled::-moz-range-thumb {
  background: lightgray;
}

canvas {
  /* avoid parent auto-resize */
  vertical-align: middle;
}

/** tooltip */
.layerGroup span {
  display: none;
  background-color: rgb(0, 0, 0);
  padding: 2px;
}

.layerGroup:hover span {
  display: inline-block;
  position: absolute;
  overflow: hidden;
}

/** crossshair */
.layerGroup hr {
  pointer-events: none;
  border: none;
  position: absolute;
  margin: 0;
}

hr.horizontal {
  border-top: 2px dashed lime;
}

hr.vertical {
  border-top: 2px dashed lime;
  transform-origin: left;
  transform: rotate(90deg);
}

#brushCursor {
  pointer-events: none;
  position: absolute;
  z-index: 100;

  width: 10px;
  height: 10px;
  border: 1px solid #fff;
  border-radius: 50%;
}


body {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  margin: 0;
  background-color: #f5f5f5;
}

.header {
  display: flex;
  justify-content: center;
}

.header2 {
  display: flex;
  justify-content: left;
}

#goBackButton {
  display: none;
  /* Initially hidden */
  background-color: transparent;
  color: #555;
  /*border: 2px solid #55555573;*/
  padding: 0.3rem 1rem;
  border-radius: 5rem;
  cursor: pointer;
  font-weight: normal;
  font-size: 0.9rem;
  box-shadow: none;
  position: absolute;
  align-items: center;
  gap: 6px;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

#goBackButton:hover {
  background-color: transparent;
  color: #000;
}

#goBackButton:hover .material-symbols-outlined {
  transform: translateX(-3px);
  color: #000;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-family: 'Material Symbols Outlined';
  font-size: 20px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.header img {
  height: 100px;
  margin-right: 15px;
  display: block;
  margin: 0 auto;
}

.wp-block-post-title h1 {
  margin-top: -7rem;
}

.form-group {
  margin-bottom: 25px;
}

.form-group #fileinput {
  width: 100%;
  margin: 0.5rem 0rem;
}

.form-group #loadprogress {
  width: 100%;
  margin: 0rem 0rem 0.5rem 0rem;
}

#loadingText {
  margin-top: 10px;
  font-weight: bold;
  color: #ffe5e5;
  position: fixed;
  /* Or 'absolute' if inside .grid-validation */
  top: 25rem;
  /* Adjust depending on layout */
  left: 50%;
  width: 50%;
  z-index: 10001;
  text-align: center;
  /* add this for text centering */
  transform: translateX(-50%);
}

#loadprogress {
  position: fixed;
  /* Or 'absolute' if inside .grid-validation */
  top: 28rem;
  /* Adjust depending on layout */
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 14px;
  appearance: none;
  border-radius: 10px;
  background-color: #ffe5e5;
  /* Light red background */
  overflow: hidden;
  z-index: 10001;
  /* box-shadow: 0 0 8px rgba(0, 0, 0, 0.2); */
}

/* Firefox */
#loadprogress::-moz-progress-bar {
  background-color: #FF4041;
  border-radius: 10px;
}

/* Chrome / Safari */
#loadprogress::-webkit-progress-bar {
  background-color: #ffe5e5;
  border-radius: 10px;
}

#loadprogress::-webkit-progress-value {
  background-color: #FF4041;
  border-radius: 10px;
}

.grid-validation .overlay {
  z-index: 9999;
  /* Still blocks interaction */
}

label {
  display: grid;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.arrow-icon {
  fill: gray;
  transition: transform 0.3s ease;
}

.arrow-icon.expanded {
  fill: gray;
  transform: rotate(90deg);
  /* turns right arrow to point down */
}

select {
  appearance: none;
  /* Remove default styling */
  -webkit-appearance: none;
  /* Safari/Chrome */
  -moz-appearance: none;
  /* Firefox */
  background: url('data:image/svg+xml;utf8,<svg fill="gray" height="16" width="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" transform="rotate(90)"><path d="M8 5v14l11-7z"></path> </svg>') no-repeat right 10px center;
  background-size: 16px 16px;
  padding-right: 30px;
  /* space for the arrow */
}

input,
select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  font-size: 14px;
  transition: border-color 0.3s ease;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}



input:focus,
select:focus {
  outline: none;
  border-color: #FF4041;
}

.dicom-button:disabled {
  background-color: #ccc;
  color: #666;
  border: 1px solid #999;
}

button {
  background: #FF4041;
  color: white;
  border: none;
  padding: 0.5rem 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 16px;
  transition: opacity 0.3s ease;
}

button:hover {
  background: #e63946;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.button-slot {
  display: flex;
  justify-content: center;
  align-items: center;
}

#loadButton {
  margin-top: 1rem;
  display: block !important;
  visibility: visible !important;
}

.study-dicom-header {
  padding: 0.2rem 0.6rem;
  margin: 0;
}

.study-header-title {
  display: grid;
  grid-template-columns: 1fr auto;
  /* h3 takes remaining space, button fits content */
  align-items: center;
  /* optional: vertically center content */
  gap: 1rem;
  /* optional: space between title and button */
  margin: 0.2rem 0 1rem 0;
}

.study-header-title h3 {
  margin: 0;
  /* optional: remove default spacing */
  text-align: left;
  /* explicitly align left */

}

.study-header-title button {
  justify-self: end;
  /* push button to far right */
  padding: 0.2rem 0.6rem;
}

.disabled-view-button {
  background-color: rgba(255, 0, 0, 0.5);
  pointer-events: none;
  /* Prevents clicks */
  cursor: not-allowed;
}

/* Contenedor animado genérico */
.transition-card {
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform-origin: left center;
}

/* Ocultar suavemente */
.fade-out {
  opacity: 0;
  transform: scaleX(0.8);
  pointer-events: none;
}

/* Mostrar suavemente */
.fade-in {
  opacity: 1;
  transform: scaleX(1);
  pointer-events: auto;
}

/* Asegura estilos base */
#formContainer,
#resultsContainer {
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  background-color: white;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
}

#formContainer {
  max-width: 100vh;
  margin-left: auto;
  margin-right: auto;
}

.warning-badge {
  background: #FFEBEE;
  color: #FF4041;
  padding: 0.7rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0rem 0rem 0.7rem 0rem;
}

.expandable-section {
  border: 1px solid #eee;
  border-radius: 0.5rem;
  margin: 15px 0;
}

.section-header {
  padding: 15px;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-radius: 0.5rem;
}

.section-header span {
  font-size: 16px;
  color: #333;
  margin-left: auto;
}


.section-header.correct {
  background-color: #d4edda;
  /* Light green background */
  border: 1px solid #28a745;
  /* Green border */
  color: #155724;
  /* Dark green text */
}

.section-header.warning {
  background-color: #f8d7da;
  /* Light red background */
  border: 1px solid #dc3545;
  /* Red border */
  color: #721c24;
  /* Dark red text */
}

#studiesContainer>*:not(:last-child) {
  padding-bottom: 1rem;
}

.study-header {
  display: flex;
  justify-content: space-between;
  /* Optional: space out the items */
  align-items: center;
  /* Optional: align them vertically in the center */
}

.study-header h3 {
  margin: 0;
  /* Remove default margin */
}

.study-header small {
  font-size: 0.9em;
  /* Optional: adjust the size of the date */
  color: #777;
  /* Optional: adjust the color */
  margin-right: 1rem;
  /* Optional: add some space to the right */
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  cursor: pointer;
}

.study-header h4 {
  margin: 0;
}

.study-header small {
  color: #666;
}

.right-info {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Space between date and arrow */
}

.right-info small {
  font-size: 14px;
  color: #666;
  /* Neutral color for date */
}

.right-info span {
  font-size: 16px;
  color: #333;
  /* Color for arrow */
}

.study-details.two-columns {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.metadata-row,
.series-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4rem, 1fr));
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.metadata-item {
  padding: 0.1rem;
  color: #666;
}

.metadata-item span:first-child {
  color: #666;
  font-size: 14px;
}

.metadata-item span:last-child {
  color: inherit;
  font-weight: 500;
  font-size: 14px;
}

.metadata-column {
  flex: 1;
  min-width: 250px;
}

.viewer-column {
  flex: 1;
  min-width: 300px;
}


.viewer-controls button {
  padding: 0.5rem 2rem;
}


.viewer-controls {
  text-align: center;
  margin-top: 0.5rem;

}

#sliceSlider {
  margin: 0 10px;
}

#sliceCount {
  font-weight: bold;
  color: #FF4041;
}

.grid-layout {
  display: grid;
  background-color: white;
  border-radius: inherit;
  /*grid-template-columns: 1fr 2fr; /* Columna 1 (info + warnings), Columna 2 (viewer) */
  grid-template-rows: 1 1;
  /* Fila 1 (info), Fila 2 (warnings) */
  gap: 1rem;
  align-items: start;
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  height: 78vh;
}


.dicom-viewer {
  height: auto;
  width: 100%;
  grid-column: 2;
  grid-row: 1 / span 2;
  /* Ocupa las dos filas verticalmente */
  min-height: 500px;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  background: #000;
  margin: auto;
  position: relative;
}


.wp-block-group .wp-block-group-is-layout-constrained h1 {
  margin-top: -6rem;
}

:root {
  --wp--style--global--content-size: 70rem;
  --wp--style--global--wide-size: auto;
}

.grid-validation {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 2fr;
  /* izquierda/derecha */
  gap: 1rem;
  align-items: start;
  position: relative;
  overflow: hidden;
  overflow-y: auto;
}


/* Blur and disable */
.grid-validation.disabled {
  filter: blur(10px);
  opacity: 0.6;
  user-select: none;
  background-color: rgba(0, 0, 0, 0.1);
  /* Light gray overlay */
}

/* Overlay that blocks all interaction */
.grid-validation .overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 9999;
}

/* Show the overlay only when disabled */
.grid-validation.disabled .overlay {
  display: block;
  cursor: not-allowed;
}

.left {
  background-color: inherit;
  border-radius: 0.5rem;
  overflow: auto;
  padding-right: 0.5rem;
}

.viewer-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 78vh;
  overflow-y: auto;
  overflow-x: hidden;
}

#orientation-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.5rem;
  gap: 2rem;
}

.series-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.series-header h4 {
  margin: 0;
  font-size: 1.1rem;
}


#logo {
  height: 3rem;
  display: block;
}

.series-list>*:not(:last-child) {
  margin-bottom: 1rem;
}

.series-card {
  border: 1px solid #efefef;
  /* light gray, thin border */
  border-radius: 4px;
  /* optional: slightly rounded corners */
  padding: 10px;
  /* optional: spacing inside */
}

.series-non-valid {
  background-color: #f5f5f5;
}

.series-non-valid h4 {
  color: #999999bd;
  /* Gray color for non-valid series */
}

.series-non-valid .metadata-item {
  color: #999999bd;
  /* Gray color for non-valid metadata */
}

.series-non-valid button {
  background-color: rgba(255, 0, 0, 0.5);
  /* Transparent red for non-valid button */
}

.series-non-valid button:hover {
  background-color: rgba(188, 9, 9, 0.7);
  /* Transparent red a little darker for non-valid button */
}

.series-card h4 {
  margin: 0.2rem 0 0.2rem 0;
}

.viewer-card {
  margin: 0.5rem 0 0.2rem 0;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: white;
  border-radius: 0.5rem;
  width: 80vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* prevent full modal scrolling */
  position: relative;
  /*justify-content: center;*/
}

.modal-content h3 {
  margin: 0;
  padding: 1rem;
  font-size: 1.2rem;
  border-bottom: 1px solid #eee;
  background-color: white;
  position: relative;
  z-index: 1;
}

.close-button {
  position: absolute;
  right: 1rem;
  top: 0.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
  background-color: none;
}

.close-button:hover {
  color: #FF4041;
}

#modalBody {
  overflow-y: auto;
  /* only vertical scroll here */
  overflow-x: hidden;
  /* remove horizontal scroll */
  max-height: none;
  padding: 0.5rem;
  flex: 1;
}

/* Optional: Table styles */
#modalBody table {
  width: 100%;
  border-collapse: collapse;
}

#modalBody th,
#modalBody td {
  padding: 0.5rem;
  border: 1px solid #ddd;
  word-break: break-word;
  /* wrap long strings */
}

footer {
  position: relative;
  font-size: 10px;
  right: 0;
  z-index: 1000;
  max-width: 100%;
  margin-top: auto;
}

.footer {
  text-align: center;
}

/* Page content styles */
.page-content {
  display: none;
  padding: 20px;
  animation: fadeIn 0.3s ease-in;
  overflow-y: auto;
  overflow-x: hidden;
}

.page-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }

  .sidebar-title {
    font-size: 16px;
  }

  .nav-item {
    padding: 12px 20px;
    font-size: 13px;
  }
}

/* Settings Page Styles */
.settings-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.user-info-section,
.profile-edit-section,
.app-settings-section {
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-info-section h3,
.profile-edit-section h3,
.app-settings-section h3 {
  margin: 0 0 15px 0;
  color: #2c5aa0;
  font-size: 18px;
  font-weight: 600;
}

.user-info-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item label {
  font-weight: 600;
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item span {
  color: #333;
  font-size: 14px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.profile-form .form-group {
  margin-bottom: 20px;
}

.profile-form label {
  display: block;
  margin-bottom: 6px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.profile-form input,
.profile-form select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e1e1e1;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.profile-form input:focus,
.profile-form select:focus {
  outline: none;
  border-color: #2c5aa0;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-help {
  display: block;
  margin-top: 4px;
  color: #666;
  font-size: 12px;
  font-style: italic;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.update-btn,
.cancel-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.update-btn {
  background: #28a745;
  color: white;
}

.update-btn:hover {
  background: #218838;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.cancel-btn {
  background: #6c757d;
  color: white;
}

.cancel-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.profile-message {
  margin-top: 15px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  display: none;
}

.profile-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.profile-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f1b0b7;
  display: block;
}

.profile-message.loading {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #b6d4da;
  display: block;
}


/* Login page styles */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-container {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.login-logo {
  height: 80px;
  margin-bottom: 1rem;
}

.login-title {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: #7f8c8d;
  margin-bottom: 2rem;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form input {
  padding: 1rem;
  border: 2px solid #e1e8ed;
  border-radius: 0.5rem;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.login-form input:focus {
  outline: none;
  border-color: #FF4041;
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 64, 65, 0.1);
}

.login-button {
  background: linear-gradient(135deg, #FF4041 0%, #e63946 100%);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 64, 65, 0.3);
}

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

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

.login-error {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 0.5rem;
  display: none;
  padding: 0.5rem;
  background: #fdf2f2;
  border-radius: 0.25rem;
  border-left: 4px solid #e74c3c;
}

.forgot-password {
  color: #7f8c8d;
  font-size: 12px;
  margin-top: 1rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #FF4041;
}

/* Hide main content when login is shown */
body.login-active .sidebar,
body.login-active .main-content {
  display: none;
}

/* User info in sidebar */
.user-info {
  margin-top: 0.5rem;
  font-size: 12px;
  color: #6c757d;
}

/* Logout button styles */
.logout-btn {
  margin-top: auto;
  background-color: #dc3545 !important;
  color: white !important;
}

.logout-btn:hover {
  background-color: #c82333 !important;
  transform: translateX(5px);
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 300px;
  max-width: 500px;
  z-index: 10001;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-success .notification-content {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.notification-error .notification-content {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.notification-info .notification-content {
  background: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.notification-message {
  flex: 1;
  margin-right: 1rem;
}

.notification-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.notification-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Loading states */
.login-form.loading .login-button {
  position: relative;
  color: transparent;
}

.login-form.loading .login-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive design for login */
@media (max-width: 480px) {
  .login-container {
    margin: 1rem;
    padding: 1.5rem;
  }

  .login-title {
    font-size: 20px;
  }

  .notification {
    right: 10px;
    left: 10px;
    min-width: auto;
  }
}

/* Enhanced Edit Field Styles */
.edit-field {
  position: relative;
  transition: all 0.3s ease;
}

.readonly-field {
  background-color: #f8f9fa !important;
  color: #6c757d !important;
  border-color: #e9ecef !important;
  cursor: pointer;
}

.readonly-field:hover {
  background-color: #e9ecef !important;
  border-color: #ced4da !important;
}

.readonly-field-disabled {
  background-color: #e9ecef !important;
  color: #6c757d !important;
  border-color: #ced4da !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

.edit-field:not(.readonly-field) {
  background-color: white !important;
  color: #333 !important;
  border-color: #2c5aa0 !important;
}

.edit-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.3s ease;
}

.edit-toggle-btn:hover {
  background-color: #f8f9fa;
  color: #2c5aa0;
}

.edit-toggle-btn.editing {
  color: #28a745;
}

.form-group {
  position: relative;
}

.password-edit-group {
  animation: slideDown 0.3s ease-out;
}

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

  to {
    opacity: 1;
    max-height: 200px;
    transform: translateY(0);
  }
}

.password-edit-group.hiding {
  animation: slideUp 0.3s ease-in;
}

@keyframes slideUp {
  from {
    opacity: 1;
    max-height: 200px;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
}

/* Responsive design for new layout */
@media (max-width: 768px) {
  .edit-toggle-btn {
    position: static;
    transform: none;
    margin-top: 8px;
    display: inline-block;
  }

  .form-group {
    position: static;
  }
}

/* STL Viewer Styles */
.stl-viewer-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 86vh;
  padding-right: 10px;
}

.stl-viewer-section {
  display: none; /* Initially hidden */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.stl-viewer-section.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.stl-viewer-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  height: 100%;
}

.stl-left-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 500px;
}

.stl-right-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 500px;
}

.stl-upload-section {
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stl-upload-section h3 {
  margin: 0 0 15px 0;
  color: #2c5aa0;
  font-size: 18px;
  font-weight: 600;
}

.stl-file-input {
  margin-bottom: 10px;
}

.stl-load-btn {
  background: #FF4041;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.stl-load-btn:hover:not(:disabled) {
  background: #e63946;
  transform: translateY(-1px);
}

.stl-load-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.stl-loading {
  text-align: center;
  margin-top: 15px;
}

.stl-loading p {
  margin-bottom: 10px;
  color: #666;
}

#stlProgress {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background-color: #f0f0f0;
}

#stlProgress::-webkit-progress-bar {
  background-color: #f0f0f0;
  border-radius: 4px;
}

#stlProgress::-webkit-progress-value {
  background-color: #FF4041;
  border-radius: 4px;
}

#stlProgress::-moz-progress-bar {
  background-color: #FF4041;
  border-radius: 4px;
}

.stl-viewer-section {
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex: 1;
}

.stl-viewer-section h3 {
  margin: 0 0 15px 0;
  color: #2c5aa0;
  font-size: 18px;
  font-weight: 600;
}

.stl-3d-viewer {
  width: 100%;
  height: 500px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.stl-placeholder {
  text-align: center;
  color: #666;
  font-size: 16px;
}

.stl-placeholder p {
  margin: 0;
}

.stl-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.rotation-control {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.rotation-control label {
  font-weight: 600;
  color: #333;
  min-width: 80px;
}

.rotation-slider {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.rotation-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF4041;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.rotation-slider::-webkit-slider-thumb:hover {
  background: #e63946;
  transform: scale(1.1);
}

.rotation-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF4041;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rotation-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#rotationValue {
  font-weight: bold;
  color: #FF4041;
  min-width: 40px;
  text-align: center;
}

.viewer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.control-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.control-btn:hover:not(:disabled) {
  background: #5a6268;
  transform: translateY(-1px);
}

.control-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.stl-info {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.stl-info h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

/* Responsive design for STL viewer */
@media (max-width: 768px) {
  .page-content {
    height: calc(100vh - 80px);
  }
  
  .stl-viewer-container {
    height: 100%;
    gap: 1rem;
  }
  
  .stl-viewer-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  
  .stl-left-panel {
    min-height: auto;
  }
  
  .stl-right-panel {
    min-height: 400px;
  }
  
  .stl-3d-viewer {
    height: 300px;
  }
  
  .rotation-control {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .rotation-control label {
    min-width: auto;
    text-align: center;
  }
  
  .viewer-controls {
    flex-direction: column;
  }
  
  .control-btn {
    width: 100%;
    justify-content: center;
  }
}

/* 3D Canvas styles */
.stl-3d-viewer canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
}

/* STL Manager Styles */
.stl-manager {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 78vh;
  overflow: auto;
}

.stl-manager h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
}

.stl-files-list {
  flex: 1;
  overflow-y: auto;

  margin-bottom: 15px;

}

.stl-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.stl-file-item.hidden {
  opacity: 0.5;
  background: #f5f5f5;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.file-color-picker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  opacity: 0;
  position: absolute;
  z-index: 2;
}

.file-color-picker + .color-display {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--color-value, #B71C1C);
  position: relative;
  z-index: 1;
}

.file-color-picker:hover + .color-display {
  border-color: #FF4041;
  transform: scale(1.1);
}

.file-color-picker:focus + .color-display {
  border-color: #FF4041;
  box-shadow: 0 0 0 3px rgba(255, 64, 65, 0.2);
}

.file-details {
  display: flex;
  flex-direction: column;
}

.file-name {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.file-size {
  font-size: 12px;
  color: #666;
}

.file-format {
  font-size: 10px;
  color: #999;
  font-style: italic;
  margin-top: 2px;
}

.original-color-badge {
  display: inline-block;
  font-size: 10px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  margin-top: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.file-controls {
  display: flex;
  gap: 5px;
}

.toggle-btn, .remove-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.toggle-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.remove-btn:hover {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.manager-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  border-top: 1px solid #e9ecef;
  padding-top: 15px;
}

.manager-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.manager-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Responsive design for file manager */
@media (max-width: 768px) {
  .stl-file-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .file-info {
    justify-content: center;
  }
  
  .file-controls {
    justify-content: center;
  }
  
  .manager-controls {
    flex-direction: column;
  }
  
  .manager-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Custom scrollbar for STL viewer container */
.stl-viewer-container::-webkit-scrollbar {
  width: 8px;
}

.stl-viewer-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.stl-viewer-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.stl-viewer-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Hide overflow on body and html to prevent double scrollbars */
body, html {
  overflow-x: hidden;
}