/* Estilos generales */
body {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: auto;
}

/* Estilos de login */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white;
}

/* Estilos de formulario de entrada */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.image-preview {
    width: 100%;
    height: 240px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.camera-placeholder {
    font-size: 3rem;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
}

.camera-placeholder p {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    color: #6c757d;
}

/* Estilos para la sección de administración */
.admin-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
    margin: 0.5rem 0;
}

.measurement-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.measurement-table th,
.measurement-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.measurement-table th {
    background-color: #f1f1f1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.thumbnail:hover {
    transform: scale(1.1);
}

/* Estilos para las tablas de datos antropométricos */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Estilos para los modales */
.modal-content {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.modal-header {
    border-bottom: none;
}

.modal-body {
    padding: 1.5rem;
}

/* Estilos para botones de acción */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
    margin-right: 0.25rem;
}

.delete-btn {
    background-color: #dc3545;
    border-color: #dc3545;
}

.delete-btn:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

.view-details-btn {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

.view-details-btn:hover {
    background-color: #31d2f2;
    border-color: #25cff2;
}

/* Estilos para pestañas y tarjetas */
.card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Indicadores de confianza */
.text-success {
    color: #198754 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Tooltips para información adicional */
[title] {
    cursor: help;
}

/* Alertas mejoradas */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-dismissible .btn-close {
    padding: 1rem 1.5rem;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

/* Responsividad mejorada */
@media (max-width: 991.98px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    .admin-container {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Animaciones para mejora de UX */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

/* Estilos para tooltips en medidas antropométricas */
.measure-info {
    position: relative;
    display: inline-block;
}

.measure-info .measure-tooltip {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.measure-info:hover .measure-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Estilos para advertencias de imágenes */
.image-warning {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 193, 7, 0.8);
    color: #212529;
    padding: 0.5rem;
    font-size: 0.8rem;
    text-align: center;
}

.image-warning i {
    margin-right: 0.25rem;
}

/* Estilos para indicador de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
}

.loading-content p {
    margin-bottom: 0;
    color: #495057;
}

/* Estilos para la visualización de la detección de pose */
.pose-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Estilos para los mensajes de estado de procesamiento */
#pose-status-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 300px;
    z-index: 1000;
}

.image-preview {
    width: 100%;
    height: 300px; /* Aumentado para mejor visualización */
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.camera-placeholder {
    font-size: 3rem;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
}

.camera-placeholder p {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    color: #6c757d;
}

/* Advertencias en las imágenes */
.image-warning {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 193, 7, 0.8);
    color: #212529;
    padding: 0.5rem;
    font-size: 0.8rem;
    text-align: center;
}

/* Indicador de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
}

.loading-content p {
    margin-bottom: 0;
    color: #495057;
}

/* Estilos para los badges de método */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Estilos para las tarjetas de estadísticas */
.stats-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
    margin: 0.5rem 0;
}

/* Estilos responsivos para el panel de administración */
@media (max-width: 991.98px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.reference-editor-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f8f8;
}

#referenceEditorCanvas {
    max-width: 100%;
    display: block;
    background-color: #f8f8f8;
}

/* Resaltar filas según el estado de procesamiento */
.table-danger {
    background-color: rgba(255, 192, 192, 0.3);
}

.table-primary {
    background-color: rgba(192, 192, 255, 0.3);
}

.table-success {
    background-color: rgba(192, 255, 192, 0.3);
}

#referenceEditorModal .modal-dialog {
    max-width: 90%;
    max-height: 90vh;
    margin: 2vh auto;
}

#referenceEditorModal .modal-content {
    height: 96vh;
    display: flex;
    flex-direction: column;
}

#referenceEditorModal .modal-body {
    flex: 1;
    overflow: auto;
    padding: 0.5rem;
}

.reference-editor-container {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f8f8;
    display: flex;
    justify-content: center;
    align-items: center;
}

#referenceEditorCanvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    background-color: #f8f8f8;
}

/* Estilos para puntos antropométricos */
.anthropometric-point {
    cursor: move;
    position: absolute;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.anthropometric-point::after {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    top: -5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
}

.anthropometric-point:hover {
    transform: scale(1.2);
}

.anthropometric-line {
    position: absolute;
    background-color: transparent;
    border-left: 2px dashed;
    z-index: 90;
    pointer-events: none;
}

.measurement-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 95;
}

/* Colores para los diferentes puntos */
.point-top { background-color: rgba(255, 0, 0, 0.8); }
.point-ground { background-color: rgba(0, 0, 255, 0.8); }
.point-eyeLevel { background-color: rgba(0, 255, 0, 0.8); }
.point-shoulderLevel { background-color: rgba(255, 255, 0, 0.8); }
.point-elbowLevel { background-color: rgba(255, 0, 255, 0.8); }
.point-back { background-color: rgba(0, 255, 255, 0.8); }
.point-fistReach { background-color: rgba(255, 165, 0, 0.8); }
.point-kneeTop { background-color: rgba(128, 0, 128, 0.8); }
.point-seatLevel { background-color: rgba(0, 128, 128, 0.8); }
.point-kneePoint { background-color: rgba(128, 128, 0, 0.8); }
.point-glutePoint { background-color: rgba(0, 128, 0, 0.8); }

/* Animaciones para puntos de medición */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.measurement-point-hover {
    animation: pulse 0.5s ease-in-out;
}

/* Cursor de mano cuando pasa por encima de los puntos */
canvas {
    cursor: default;
}

.reference-editor-fullscreen {
  padding: 12px;
}

/* Permitir scroll real del modal */
.modal-fullscreen .modal-content {
  height: auto;
}

.modal-fullscreen .modal-body {
  overflow-y: auto;
}

/* ---------- TOP: 3 canvases ---------- */

.reference-editor-grid-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.ref-canvas-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ref-canvas-title {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-weight: 600;
  background: rgba(0,0,0,.03);
}

.ref-canvas-card canvas {
  width: 100%;
  height: 520px;            /* ALTURA REAL, NO SE APLASTA */
  display: block;
  cursor: crosshair;
}

/* ---------- BOTTOM: measures ---------- */

.ref-bottom-panel {
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  padding: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .reference-editor-grid-top {
    grid-template-columns: 1fr;
  }

  .ref-canvas-card canvas {
    height: 420px;
  }
}