/*=============================================
ESTILOS RESPONSIVE PARA PLANTILLAS
=============================================*/

/* Vista Previa Canvas */
#canvasPreview {
    transition: all 0.3s ease;
}

#canvasPreview:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Marcadores */
[id^="marcador"] {
    transition: all 0.2s ease;
    cursor: default;
}

/* Selector de Modo */
#modoSelector {
    transition: border-color 0.3s ease;
}

#modoSelector:focus {
    border-color: #00a65a;
    box-shadow: 0 0 0 0.2rem rgba(0, 166, 90, 0.25);
}

/* Responsive Tablets */
@media (max-width: 992px) {
    #canvasPreview {
        max-width: 250px;
    }
    
    [id^="marcador"] {
        font-size: 8px !important;
        padding: 2px 5px !important;
    }
    
    #marcadorPrecio {
        width: 25px !important;
        height: 25px !important;
    }
}

/* Responsive Móviles */
@media (max-width: 768px) {
    #canvasPreview {
        max-width: 200px;
    }
    
    .panel-body {
        padding: 10px;
    }
    
    #modoSelector {
        font-size: 12px;
        max-width: 180px !important;
    }
    
    [id^="marcador"] {
        font-size: 7px !important;
        padding: 2px 4px !important;
    }
    
    #marcadorPrecio {
        width: 20px !important;
        height: 20px !important;
        font-size: 7px !important;
    }
}

/* Modo Oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    #canvasPreview {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .panel-success .panel-heading {
        background: #27ae60 !important;
    }
}

/* Animaciones */
@keyframes pulso {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

[id^="marcador"].activo {
    animation: pulso 0.5s ease;
}

/* Tooltip para coordenadas */
.coord-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

/* Estilos para SVG responsive */
svg {
    max-width: 100%;
    height: auto;
}

/* Panel de vista previa mejorado */
.panel-success {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
}

.panel-success .panel-heading {
    border-radius: 5px 5px 0 0;
}

.panel-success .panel-body {
    border-radius: 0 0 5px 5px;
}

/* Botones de ayuda */
.help-icon {
    cursor: help;
    color: #3498db;
    margin-left: 5px;
}

.help-icon:hover {
    color: #2980b9;
}

/* Estados del canvas */
.canvas-activo {
    border-color: #00a65a !important;
    box-shadow: 0 0 0 3px rgba(0, 166, 90, 0.2) !important;
}

.canvas-deshabilitado {
    opacity: 0.6;
    cursor: not-allowed !important;
}

/* Números en la cuadrícula - mejor legibilidad */
svg text {
    font-family: 'Arial', sans-serif;
    font-weight: normal;
}

svg text[font-weight="bold"] {
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

/* Loading state */
.canvas-loading {
    position: relative;
}

.canvas-loading::after {
    content: "⏳ Cargando...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    color: #333;
}

/* Accesibilidad */
*:focus {
    outline: 2px solid #00a65a;
    outline-offset: 2px;
}

button:focus,
select:focus,
input:focus {
    outline: 2px solid #00a65a;
}

/* Print styles */
@media print {
    #canvasPreview,
    #modoSelector,
    .panel-success {
        display: none !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    [id^="marcador"] {
        border-width: 3px !important;
    }
    
    svg line {
        opacity: 0.8 !important;
    }
}

/* Reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

