/* API Documentation Styles */
.code-block {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #edf2f7;
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.code-block pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
}

.code-block code {
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
}

.btn-copy {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-color);
  transition: color 0.2s;
}

.btn-copy:hover {
  color: var(--primary-color);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-download:hover {
  background: var(--primary-hover);
}

.download-button {
  margin: 1rem 0;
}

.instruction-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.instruction-section h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.instruction-section h3 {
  margin: 1.5rem 0 1rem;
}

.instruction-section p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* ----------------------------------
   1) RESET & BASE LAYOUT
---------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* Loader Styles */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

body.loading {
    overflow: hidden;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loader-text {
    color: var(--text-color);
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
}

body {
    display: flex;
    flex-direction: column;
}

/* ----------------------------------
   2) NAVBAR
---------------------------------- */
#navbar {
    background-color: #1e40af;
    color: #ffffff;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-md);
}

#navbarLogo {
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

#navbarLinks {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    
}

#navbarLinks a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    
}

#navbarLinks a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Highlight active main tab */
#navbarLinks a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* ----------------------------------
   3) MAIN FLEX CONTAINER
---------------------------------- */
/* We will wrap each major tab section in .tabContent
   so we can show/hide them easily with display:flex or none */
.tabContent {
    width: 100%;
    height: calc(100vh - 60px);
    /* minus navbar */
    display: none;
    /* hidden by default, show only the active one */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--border-color);
}

/* The existing #mainContainer is now specifically for the Image Picker tab */
#mainContainer {
    flex: 1;
    display: flex;
    height: calc(100vh - 60px);
    background: var(--bg-color);
    gap: 0.75rem;
    padding: 0.75rem;
    overflow: hidden;
}

/* LEFT COLUMN (#col1) - IMAGE PANEL */
#col1 {
    flex: 2;
    /* give more width to the image panel */
    display: flex;
    flex-direction: column;
    
    min-height: 0;
    max-height: calc(100vh - 60px - 1.5rem);
    /* important to allow internal flex items to shrink */
}

/* RIGHT COLUMN (#col2) - COLOR TABLE */
#col2 {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    
    min-height: 0;
    min-width: fit-content;
}

/* ----------------------------------
   4) IMAGE PANEL LAYOUT
---------------------------------- */
#imagePanel {
    display: flex;
    flex-direction: column;
    flex: 1;
    border: 1px solid var(--border-color);
    background: #ffffff;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* TOP BAR INSIDE IMAGE PANEL */
#sourceControls {
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.input-methods {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.radio-group input[type="radio"] {
    margin-right: 0.25rem;
}

.radio-group label {
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
}

.input-container {
    display: flex;
    width: 100%;
}

.input-field {
    flex: 1;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    height: 38px;
    line-height: 1.5;
}

.input-container button {
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    height: 38px;
    margin-top: 7px;
}

.input-container button:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

#fileInput {
    cursor: pointer;
}

#pasteHint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    cursor: pointer;
}

#urlInput {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

#urlInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

#pasteHint i {
    font-size: 1.25rem;
}

.content-wrapper {
    display: flex;
    flex: 1;
    min-height: 0;
}

#metricsPanel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    width: 150px;
    order: 1;
}

#magnifierCanvas {
    width: 100%;
    height: 150px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    padding: 0;
}

#metricsPanel button {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
}

#metricsPanel div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

#photoContainer {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: auto;
    background-color: #CCC;
    background-image: linear-gradient(45deg, white 25%, transparent 25%, transparent 75%, white 75%, white),
        linear-gradient(45deg, white 25%, transparent 25%, transparent 75%, white 75%, white);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-attachment: local;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

#mainCanvas {
    display: block;
    cursor: crosshair;    
    transform-origin: top left;
    will-change: transform;
    position: relative;
  }

#photoContainer::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#photoContainer::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

#photoContainer::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

#photoContainer::-webkit-scrollbar-corner {
    background: var(--border-color);
}



/* The canvas itself */
#mainCanvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
}

/* METRICS (Pixel coords, Zoom, Magnifier) */
#metricsPanel {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #f8fafc;
    
    border-top: 1px solid var(--border-color);
    gap: 0.75rem;
}

#metricsPanel div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0px!important;
}

#metricsPanel button {
    padding: 0.375rem 0.75rem;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

#metricsPanel button:hover:not(:disabled) {
    background: var(--primary-hover);
}

#metricsPanel button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

#magnifierCanvas {
    width: 100%;
    height: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #CCC;
    background-image: linear-gradient(45deg, white 25%, transparent 25%, transparent 75%, white 75%, white),
        linear-gradient(45deg, white 25%, transparent 25%, transparent 75%, white 75%, white);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    box-shadow: var(--shadow-sm);
    padding: 0;
}

/* ----------------------------------
   5) COLOR TABLE LAYOUT (Right Column)
---------------------------------- */
#tablePanel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.formatTableWrapper {
    flex: 1;
    overflow-y: auto;
}

/* EXPORT BUTTONS */
#exportButtons {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

#exportButtons button {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    flex: 1;
    text-wrap: nowrap;
}

#exportButtons button:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ----------------------------------
   NEW: Sub-tabs for color formats
---------------------------------- */
/* Format tabs */
#formatTabs {
    display: flex;
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    width: auto;
    
}

.formatTab {
    flex: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    background: #ffffff;
    transition: all 0.2s ease;
    font-weight: 500;
    text-align: center;
    margin: 0 0.25rem;
    font-size: 0.8rem;
    text-wrap: nowrap;
}

.formatTab.disabled {
  pointer-events: none;
  opacity: 0.5;
}


.formatTab:first-child {
    margin-left: 0;
}

.formatTab:last-child {
    margin-right: 0;
}

.formatTab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.formatTab.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.formatTableWrapper.table-container {
    display: none;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: auto;
    width: 400px;
    margin: 1rem;
}

.formatTableWrapper.table-container.active {
    display: block;
}

  
      /* Ensure the table can be wider than its container */
.data-table {
    width: auto;                /* Allow table to take its own width */
    min-width: 100%;            /* But never be narrower than the container */
    table-layout: auto;
}
  
      .data-table table
       {
        width: 100%;
        table-layout: auto;
        
        font-size: 0.8rem;
        border: 1px solid #ddd;
      }
  
      .data-table td, 
      .data-table th  {
        text-align: left;
        border: 1px solid #ddd;
        white-space: nowrap;
        padding: 0.5rem;
        background-color: white;
      }
  
     
      .data-table td:first-child,
      .data-table th:first-child {
        position: sticky!important;
        left: 0!important;
      }  
  
      .data-table thead{
        background-color: #f2f2f2;
        position: sticky!important;
        top: 0!important;
        z-index: 1!important;
      }
      .data-table tbody {
        overflow-y: auto!important;
        
      }

            
      .data-table td:hover {
        background-color: #0277bd;
        color: white;
      }
      





.color-preview {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
}



.data-table td:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: auto!important;
}

.data-table td:first-child button {
height: 24px;
padding: 0 0.5rem;
}

.data-table td:first-child button:hover {
   background-color: #ff4444;
   color: white;
}

.data-table tr {
  transition: all 0.3s ease-out;
}

.data-table tr.removing {
  opacity: 0;
  transform: translateX(-20px);
}



/* ----------------------------------
   NEW: Hiding placeholders for the
   Spectrum / Pallets main tabs
---------------------------------- */
/* If you need special styling for #spectrumContainer or #palletsContainer,
   you can replicate #mainContainer’s approach. For now, placeholders. */
#spectrumContainer,
#palletsContainer {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #eee;
    padding: 0.75rem;
    /* min-height: 0;  etc. */
}

/* Color table action buttons */
.table-action-btn {
    padding: 6px;
    border: none;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 14px;
    border-radius: 4px;
    color: #64748b;
}

.table-action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ----------------------------------
   NOTIFICATION STYLES
---------------------------------- */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ----------------------------------
   Instructions Tab Styles
---------------------------------- */
.instructions-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1rem 1.5rem;
    background: transparent;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
}

.instructions-container::-webkit-scrollbar {
    width: 8px;
}

.instructions-container::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.instructions-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.instructions-container::-webkit-scrollbar-corner {
    background: var(--border-color);
}

.instruction-section {
    margin-bottom: 2rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: transform 0.2s ease;
}

.instruction-section:hover {
    transform: translateY(-2px);
}

.instruction-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.instruction-section h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instruction-section h3::before {
    content: "";
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

.instruction-section ul {
    list-style-type: none;
    margin-left: 0;
    line-height: 1.8;
}

.instruction-section ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.instruction-section ul li::before {
    content: "•";
    color: var(--primary-color);
    font-size: 1.5em;
    position: absolute;
    left: 0;
    top: -0.2em;
}

.instruction-section ul ul {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
}

.instruction-section ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.instruction-section li {
    margin-bottom: 0.5rem;
}

.instruction-section strong {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin: 0 0.25rem;
}

.action-button:hover {
    background: var(--primary-hover);
}

.combination-group {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
}

.combination-group h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.combination-group p {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.combination-display {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.combination-color {
    flex: 1;
    height: 60px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.notification-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-overlay.show {
    opacity: 1;
}

.notification {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    position: relative;
    min-width: 300px;
    max-width: 90%;
    margin: 1rem;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateY(0);
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.success {
    border-left: 4px solid #22c55e;
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

.notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
    line-height: 1;
}

.notification-close:hover {
    color: #1e293b;
}

/* ----------------------------------
   RESPONSIVE DESIGN
---------------------------------- */
/* 1) Make the navbar sticky & full width */
#navbar {
    position: sticky;
    top: 0;
    z-index: 9999;
    /* Remove or reduce the default 2rem horizontal padding on mobile */
  }
  
  @media screen and (max-width: 768px) {
    body {
      overflow-y: auto;
    }
  
    /* Cambiar el navbar a dos filas */
    #navbar {
      flex-direction: column;
      align-items: center;
      height: auto; /* se elimina la altura fija */
      padding: 0.5rem 1rem; /* se ajusta el padding */
    }
  
    /* Separar el logo de los links */
    #navbarLogo {
      margin-bottom: 0.5rem;
      text-align: center;
    }
/* Instructions Tab Styles */
.instructions-container {
    max-width: 100%;
    padding: 1rem;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.instruction-section {
    margin-bottom: 1rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.instruction-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.instruction-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.instruction-section ul {
    list-style: none;
    padding-left: 1.5rem;
}

.instruction-section ul li {
    margin-bottom: 0.75rem;
    position: relative;
}

.instruction-section ul li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: -1.5rem;
}

.instruction-section ul ul {
    margin-top: 0.75rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .instructions-container {
        padding: 0.75rem;
    }

    .instruction-section {
        padding: 1rem;
    }

    .instruction-section ul {
        padding-left: 1rem;
    }

    .instruction-section ul li::before {
        left: -1rem;
    }

    .instruction-section ul li {
        margin-bottom: 0.5rem;
    }

    .instruction-section ul ul {
        margin-top: 0.5rem;
    }
}

    /* Usar grid en #navbarLinks para 3 columnas */
    #navbarLinks {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(3, 1fr); /* 3 columnas iguales */
      gap: 0.5rem;/* separación horizontal */
    }
  
    /* Cada link ocupa su columna */
    #navbarLinks a {
      text-align: center;
      padding: 0.5rem 0;
    }
  
    /* Tabs en móvil */
    .tabContent {
      display: none;
      width: 100%;
      min-height: 100vh;
      overflow: visible;
    }
    .tabContent.active {
      display: flex;
      flex-direction: column;
    }
  
    /* Contenedor principal en columna */
    #mainContainer {
      display: flex;
      flex-direction: column;
      width: 100%;
      padding: 0.5rem;
      gap: 0.5rem;
      overflow: visible;
    }
  
    /* Columna izquierda: imagen */
    #col1 {
      flex: 1 0 calc(100vh - 130px);
      width: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0;
      position: relative;
    }
  
    #imagePanel {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
  
    /* Canvas */
    #photoContainer {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: auto;
      width: 100%;
      height: calc(100% - 135px);
    }
  
    #mainCanvas {
      max-width: 100%;
      max-height: 100%;
      height: auto;
      width: auto;
      object-fit: contain;
      
    }
  
    /* Panel de métricas en grid */
    #metricsPanel {
      width: 100%;
      height: auto;
      flex: 0 0 auto;
      padding: 0;
      border: none;
      background: #f8fafc;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr; /* 3 columnas */
      grid-template-rows: 1fr 1fr 1fr;    /* 3 filas */
      gap: 0.5rem;
      position: absolute;
      bottom: 0;
      left: 0;
    }
  
    /* 1) Magnifier en la primera columna (ocupa 3 filas) */
    #metricsPanel > :nth-child(1) {
      grid-column: 1;
      grid-row: 1 / span 3;
      display: flex;
      align-items: stretch;
      justify-content: stretch;
    }
    
    #magnifierCanvas {
      width: 100%;
      height: 100%;
    }
  
    /* 2) Botones Zoom In/Out en la segunda columna (ocupa 3 filas) */
    #metricsPanel > :nth-child(2) {
      grid-column: 2;
      grid-row: 1 / span 3;
      display: flex;
      flex-direction: column;
      gap: 0rem; /* se mantiene el espacio vertical entre botones */
      align-items: stretch !important;
      justify-content: stretch !important; /* para que la columna se estire */
    }
    /* Cada botón se expande para ocupar el alto */
    #metricsPanel > :nth-child(2) button {
      flex: 1;           /* se expanden para llenar el espacio vertical */
      min-height: 55px;  /* pero nunca serán más pequeños de 52px */
      width: 100%;
    }
  
    /* 3) Pixel X en la tercera columna, fila 1 */
    #metricsPanel > :nth-child(3) {
      grid-column: 3;
      grid-row: 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    /* 4) Pixel Y en la tercera columna, fila 2 */
    #metricsPanel > :nth-child(4) {
      grid-column: 3;
      grid-row: 2;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    /* 5) Botón Reset en la tercera columna, fila 3 */
    #metricsPanel > :nth-child(5) {
      grid-column: 3;
      grid-row: 3;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    /* Ajustes de botones */
    #metricsPanel button {
      min-width: 80px;
      padding: 0.5rem;
    }
  
    /* Columna derecha: tabla de colores */
    #col2 {
      width: 100%;
      min-height: calc(100vh - 60px);
      overflow: hidden;
      padding: 0;
      background: #fff;
      border-top: 1px solid var(--border-color);
    }
  
    #tablePanel {
      height: 100%;
      display: flex;
      flex-direction: column;
      border: none;
      border-radius: 0;
      max-width: 100vw;
    }
  
    #formatTabs {
      max-width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
  
    .formatTableWrapper.table-container {
      width: 100%;
      margin: 0;
      padding: 0.5rem;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
  
    .data-table {
      width: 100%;
      min-width: unset;
    }
  }
  
body {
    background: radial-gradient(circle at top left, #e0f2fe 0, #f8fafc 45%, #eef2ff 100%);
}

.tabContent {
    background: transparent;
    padding: 0;
}

#imagePickerTab {
    justify-content: flex-start;
    align-items: stretch;
}

#mainContainer {
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.75rem;
    gap: 0.75rem;
}

#col1,
#col2 {
    min-height: 0;
}

#tablePanel {
    border-radius: var(--radius-md);
}

#exportButtons {
    justify-content: space-between;
    flex-wrap: wrap;
}

#exportButtons button {
    border-radius: 999px;
}

.data-table {
    border-collapse: collapse;
}

.data-table thead th {
    background: #f8fafc;
    font-weight: 600;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

@media (min-width: 1024px) {
    #mainContainer {
        display: grid;
        grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr);
        align-items: stretch;
    }

    #col1,
    #col2 {
        width: auto;
    }
}


--------------- */
/* We will wrap each major tab section in .tabContent
   so we can show/hide them easily with display:flex or none */
.tabContent {
    width: 100%;
    height: calc(100vh - 60px);
    /* minus navbar */
    display: none;
    /* hidden by default, show only the active one */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--border-color);
}

/* The existing #mainContainer is now specifically for the Image Picker tab */
#mainContainer {
    flex: 1;
    display: flex;
    height: calc(100vh - 60px);
    background: var(--bg-color);
    gap: 0.75rem;
    padding: 0.75rem;
    overflow: hidden;
}

/* LEFT COLUMN (#col1) - IMAGE PANEL */
#col1 {
    flex: 2;
    /* give more width to the image panel */
    display: flex;
    flex-direction: column;
    
    min-height: 0;
    max-height: calc(100vh - 60px - 1.5rem);
    /* important to allow internal flex items to shrink */
}

/* RIGHT COLUMN (#col2) - COLOR TABLE */
#col2 {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    
    min-height: 0;
    min-width: fit-content;
}

/* ----------------------------------
   4) IMAGE PANEL LAYOUT
---------------------------------- */
#imagePanel {
    display: flex;
    flex-direction: column;
    flex: 1;
    border: 1px solid var(--border-color);
    background: #ffffff;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* TOP BAR INSIDE IMAGE PANEL */
#sourceControls {
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.input-methods {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.radio-group input[type="radio"] {
    margin-right: 0.25rem;
}

.radio-group label {
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
}

.input-container {
    display: flex;
    width: 100%;
}

.input-field {
    flex: 1;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    height: 38px;
    line-height: 1.5;
}

.input-container button {
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    height: 38px;
    margin-top: 7px;
}

.input-container button:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

#fileInput {
    cursor: pointer;
}

#pasteHint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    cursor: pointer;
}

#urlInput {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

#urlInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

#pasteHint i {
    font-size: 1.25rem;
}

.content-wrapper {
    display: flex;
    flex: 1;
    min-height: 0;
}

#metricsPanel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    width: 150px;
    order: 1;
}

#magnifierCanvas {
    width: 100%;
    height: 150px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    padding: 0;
}

#metricsPanel button {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
}

#metricsPanel div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

#photoContainer {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: auto;
    background-color: #CCC;
    background-image: linear-gradient(45deg, white 25%, transparent 25%, transparent 75%, white 75%, white),
        linear-gradient(45deg, white 25%, transparent 25%, transparent 75%, white 75%, white);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-attachment: local;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

#mainCanvas {
    display: block;
    cursor: crosshair;    
    transform-origin: top left;
    will-change: transform;
    position: relative;
  }

#photoContainer::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#photoContainer::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

#photoContainer::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

#photoContainer::-webkit-scrollbar-corner {
    background: var(--border-color);
}



/* The canvas itself */
#mainCanvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
}

/* METRICS (Pixel coords, Zoom, Magnifier) */
#metricsPanel {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #f8fafc;
    
    border-top: 1px solid var(--border-color);
    gap: 0.75rem;
}

#metricsPanel div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0px!important;
}

#metricsPanel button {
    padding: 0.375rem 0.75rem;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

#metricsPanel button:hover:not(:disabled) {
    background: var(--primary-hover);
}

#metricsPanel button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

#magnifierCanvas {
    width: 100%;
    height: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #CCC;
    background-image: linear-gradient(45deg, white 25%, transparent 25%, transparent 75%, white 75%, white),
        linear-gradient(45deg, white 25%, transparent 25%, transparent 75%, white 75%, white);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    box-shadow: var(--shadow-sm);
    padding: 0;
}

/* ----------------------------------
   5) COLOR TABLE LAYOUT (Right Column)
---------------------------------- */
#tablePanel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.formatTableWrapper {
    flex: 1;
    overflow-y: auto;
}

/* EXPORT BUTTONS */
#exportButtons {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

#exportButtons button {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    flex: 1;
    text-wrap: nowrap;
}

#exportButtons button:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ----------------------------------
   NEW: Sub-tabs for color formats
---------------------------------- */
/* Format tabs */
#formatTabs {
    display: flex;
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    width: auto;
    
}

.formatTab {
    flex: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    background: #ffffff;
    transition: all 0.2s ease;
    font-weight: 500;
    text-align: center;
    margin: 0 0.25rem;
    font-size: 0.8rem;
    text-wrap: nowrap;
}

.formatTab.disabled {
  pointer-events: none;
  opacity: 0.5;
}


.formatTab:first-child {
    margin-left: 0;
}

.formatTab:last-child {
    margin-right: 0;
}

.formatTab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.formatTab.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.formatTableWrapper.table-container {
    display: none;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: auto;
    width: 400px;
    margin: 1rem;
}

.formatTableWrapper.table-container.active {
    display: block;
}

  
      /* Ensure the table can be wider than its container */
.data-table {
    width: auto;                /* Allow table to take its own width */
    min-width: 100%;            /* But never be narrower than the container */
    table-layout: auto;
}
  
      .data-table table
       {
        width: 100%;
        table-layout: auto;
        
        font-size: 0.8rem;
        border: 1px solid #ddd;
      }
  
      .data-table td, 
      .data-table th  {
        text-align: left;
        border: 1px solid #ddd;
        white-space: nowrap;
        padding: 0.5rem;
        background-color: white;
      }
  
     
      .data-table td:first-child,
      .data-table th:first-child {
        position: sticky!important;
        left: 0!important;
      }  
  
      .data-table thead{
        background-color: #f2f2f2;
        position: sticky!important;
        top: 0!important;
        z-index: 1!important;
      }
      .data-table tbody {
        overflow-y: auto!important;
        
      }

            
      .data-table td:hover {
        background-color: #0277bd;
        color: white;
      }
      





.color-preview {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
}



.data-table td:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: auto!important;
}

.data-table td:first-child button {
height: 24px;
padding: 0 0.5rem;
}

.data-table td:first-child button:hover {
   background-color: #ff4444;
   color: white;
}

.data-table tr {
  transition: all 0.3s ease-out;
}

.data-table tr.removing {
  opacity: 0;
  transform: translateX(-20px);
}



/* ----------------------------------
   NEW: Hiding placeholders for the
   Spectrum / Pallets main tabs
---------------------------------- */
/* If you need special styling for #spectrumContainer or #palletsContainer,
   you can replicate #mainContainer’s approach. For now, placeholders. */
#spectrumContainer,
#palletsContainer {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #eee;
    padding: 0.75rem;
    /* min-height: 0;  etc. */
}

/* Color table action buttons */
.table-action-btn {
    padding: 6px;
    border: none;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 14px;
    border-radius: 4px;
    color: #64748b;
}

.table-action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ----------------------------------
   NOTIFICATION STYLES
---------------------------------- */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ----------------------------------
   Instructions Tab Styles
---------------------------------- */
.instructions-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0;
    background: transparent;
}

.instructions-container::-webkit-scrollbar {
    width: 8px;
}

.instructions-container::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.instructions-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.instructions-container::-webkit-scrollbar-corner {
    background: var(--border-color);
}

.instruction-section {
    margin-bottom: 2rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: transform 0.2s ease;
}

.instruction-section:hover {
    transform: translateY(-2px);
}

.instruction-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.instruction-section h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instruction-section h3::before {
    content: "";
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

.instruction-section ul {
    list-style-type: none;
    margin-left: 0;
    line-height: 1.8;
}

.instruction-section ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.instruction-section ul li::before {
    content: "•";
    color: var(--primary-color);
    font-size: 1.5em;
    position: absolute;
    left: 0;
    top: -0.2em;
}

.instruction-section ul ul {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
}

.instruction-section ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.instruction-section li {
    margin-bottom: 0.5rem;
}

.instruction-section strong {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin: 0 0.25rem;
}

.action-button:hover {
    background: var(--primary-hover);
}

.combination-group {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
}

.combination-group h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.combination-group p {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.combination-display {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.combination-color {
    flex: 1;
    height: 60px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.notification-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-overlay.show {
    opacity: 1;
}

.notification {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    position: relative;
    min-width: 300px;
    max-width: 90%;
    margin: 1rem;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateY(0);
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.success {
    border-left: 4px solid #22c55e;
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

.notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
    line-height: 1;
}

.notification-close:hover {
    color: #1e293b;
}

/* ----------------------------------
   RESPONSIVE DESIGN
---------------------------------- */
/* 1) Make the navbar sticky & full width */
#navbar {
    position: sticky;
    top: 0;
    z-index: 9999;
    /* Remove or reduce the default 2rem horizontal padding on mobile */
  }
  
  @media screen and (max-width: 768px) {
    body {
      overflow-y: auto;
    }
  
    /* Cambiar el navbar a dos filas */
    #navbar {
      flex-direction: column;
      align-items: center;
      height: auto; /* se elimina la altura fija */
      padding: 0.5rem 1rem; /* se ajusta el padding */
    }
  
    /* Separar el logo de los links */
    #navbarLogo {
      margin-bottom: 0.5rem;
      text-align: center;
    }
/* Instructions Tab Styles */
.instructions-container {
    max-width: 100%;
    padding: 1rem;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.instruction-section {
    margin-bottom: 1rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.instruction-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.instruction-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.instruction-section ul {
    list-style: none;
    padding-left: 1.5rem;
}

.instruction-section ul li {
    margin-bottom: 0.75rem;
    position: relative;
}

.instruction-section ul li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: -1.5rem;
}

.instruction-section ul ul {
    margin-top: 0.75rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .instructions-container {
        padding: 0.75rem;
    }

    .instruction-section {
        padding: 1rem;
    }

    .instruction-section ul {
        padding-left: 1rem;
    }

    .instruction-section ul li::before {
        left: -1rem;
    }

    .instruction-section ul li {
        margin-bottom: 0.5rem;
    }

    .instruction-section ul ul {
        margin-top: 0.5rem;
    }
}

    /* Usar grid en #navbarLinks para 3 columnas */
    #navbarLinks {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(3, 1fr); /* 3 columnas iguales */
      gap: 0.5rem;/* separación horizontal */
    }
  
    /* Cada link ocupa su columna */
    #navbarLinks a {
      text-align: center;
      padding: 0.5rem 0;
    }
  
    /* Tabs en móvil */
    .tabContent {
      display: none;
      width: 100%;
      min-height: 100vh;
      overflow: visible;
    }
    .tabContent.active {
      display: flex;
      flex-direction: column;
    }
  
    /* Contenedor principal en columna */
    #mainContainer {
      display: flex;
      flex-direction: column;
      width: 100%;
      padding: 0.5rem;
      gap: 0.5rem;
      overflow: visible;
    }
  
    /* Columna izquierda: imagen */
    #col1 {
      flex: 1 0 calc(100vh - 130px);
      width: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 0;
      position: relative;
    }
  
    #imagePanel {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
  
    /* Canvas */
    #photoContainer {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: auto;
      width: 100%;
      height: calc(100% - 135px);
    }
  
    #mainCanvas {
      max-width: 100%;
      max-height: 100%;
      height: auto;
      width: auto;
      object-fit: contain;
      
    }
  
    /* Panel de métricas en grid */
    #metricsPanel {
      width: 100%;
      height: auto;
      flex: 0 0 auto;
      padding: 0;
      border: none;
      background: #f8fafc;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr; /* 3 columnas */
      grid-template-rows: 1fr 1fr 1fr;    /* 3 filas */
      gap: 0.5rem;
      position: absolute;
      bottom: 0;
      left: 0;
    }
  
    /* 1) Magnifier en la primera columna (ocupa 3 filas) */
    #metricsPanel > :nth-child(1) {
      grid-column: 1;
      grid-row: 1 / span 3;
      display: flex;
      align-items: stretch;
      justify-content: stretch;
    }
    
    #magnifierCanvas {
      width: 100%;
      height: 100%;
    }
  
    /* 2) Botones Zoom In/Out en la segunda columna (ocupa 3 filas) */
    #metricsPanel > :nth-child(2) {
      grid-column: 2;
      grid-row: 1 / span 3;
      display: flex;
      flex-direction: column;
      gap: 0rem; /* se mantiene el espacio vertical entre botones */
      align-items: stretch !important;
      justify-content: stretch !important; /* para que la columna se estire */
    }
    /* Cada botón se expande para ocupar el alto */
    #metricsPanel > :nth-child(2) button {
      flex: 1;           /* se expanden para llenar el espacio vertical */
      min-height: 55px;  /* pero nunca serán más pequeños de 52px */
      width: 100%;
    }
  
    /* 3) Pixel X en la tercera columna, fila 1 */
    #metricsPanel > :nth-child(3) {
      grid-column: 3;
      grid-row: 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    /* 4) Pixel Y en la tercera columna, fila 2 */
    #metricsPanel > :nth-child(4) {
      grid-column: 3;
      grid-row: 2;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    /* 5) Botón Reset en la tercera columna, fila 3 */
    #metricsPanel > :nth-child(5) {
      grid-column: 3;
      grid-row: 3;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    /* Ajustes de botones */
    #metricsPanel button {
      min-width: 80px;
      padding: 0.5rem;
    }
  
    /* Columna derecha: tabla de colores */
    #col2 {
      width: 100%;
      min-height: calc(100vh - 60px);
      overflow: hidden;
      padding: 0;
      background: #fff;
      border-top: 1px solid var(--border-color);
    }
  
    #tablePanel {
      height: 100%;
      display: flex;
      flex-direction: column;
      border: none;
      border-radius: 0;
      max-width: 100vw;
    }
  
    #formatTabs {
      max-width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
  
    .formatTableWrapper.table-container {
      width: 100%;
      margin: 0;
      padding: 0.5rem;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
  
    .data-table {
      width: 100%;
      min-width: unset;
    }
  }
  
  
  
  
  

