/**
 * Tema por defecto - Importa y combina todos los estilos
 */

/* Importar estilos base */
@import '../base/variables.css';
@import '../base/reset.css';

/* Importar componentes */
@import '../components/buttons.css';
@import '../components/controls.css';
@import '../components/panels.css';
@import '../components/overlays.css';
@import '../components/drawing.css';

/* Estilos específicos del tema por defecto */
:root {
    /* Override de variables específicas del tema */
    --theme-accent: var(--primary-blue);
    --theme-accent-hover: #2c7be5;
    --theme-accent-light: rgba(51, 136, 255, 0.1);
    
    --theme-surface: var(--bg-primary);
    --theme-surface-elevated: var(--bg-secondary);
    --theme-surface-overlay: var(--bg-panel);
    
    --theme-on-surface: var(--text-primary);
    --theme-on-surface-secondary: var(--text-secondary);
    --theme-on-surface-muted: var(--text-muted);
}

/* Estilos globales del tema */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Personalizaciones específicas para el mapa */
.maplibregl-canvas {
    cursor: default;
}

.maplibregl-ctrl-attrib {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(4px);
}

.maplibregl-ctrl-logo {
    background-image: none !important;
}

/* Personalizaciones específicas para controles */
.maplibregl-ctrl-group {
    box-shadow: var(--control-shadow);
    border-radius: var(--border-radius-md);
    background: var(--control-bg);
    backdrop-filter: blur(8px);
}

.maplibregl-ctrl-zoom-in,
.maplibregl-ctrl-zoom-out {
    background: var(--control-bg);
    color: var(--text-primary);
}

.maplibregl-ctrl-zoom-in:hover,
.maplibregl-ctrl-zoom-out:hover {
    background: var(--control-hover);
}

/* Mejoras visuales generales */
.enhanced-shadow {
    box-shadow: var(--shadow-lg);
}

.enhanced-border {
    border: 1px solid var(--theme-accent-light);
}

.enhanced-surface {
    background: var(--theme-surface-elevated);
    backdrop-filter: blur(12px);
}

/* Animaciones mejoradas */
.smooth-transition {
    transition: all var(--transition-normal);
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Estados interactivos mejorados */
.interactive {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.interactive:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.interactive:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.interactive:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}

/* Utilidades de layout */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

/* Utilidades de texto */
.text-center {
    text-align: center;
}

.text-bold {
    font-weight: var(--font-weight-bold);
}

.text-medium {
    font-weight: var(--font-weight-medium);
}

.text-muted {
    color: var(--theme-on-surface-secondary);
}

.text-accent {
    color: var(--theme-accent);
}

/* Utilidades de espaciado */
.p-sm {
    padding: var(--spacing-sm);
}

.p-md {
    padding: var(--spacing-md);
}

.p-lg {
    padding: var(--spacing-lg);
}

.m-sm {
    margin: var(--spacing-sm);
}

.m-md {
    margin: var(--spacing-md);
}

.m-lg {
    margin: var(--spacing-lg);
}

/* Utilidades de visibilidad */
.hidden {
    display: none;
}

.invisible {
    visibility: hidden;
}

.opacity-0 {
    opacity: 0;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-100 {
    opacity: 1;
}

/* Estados de componentes */
.component-loading {
    position: relative;
    overflow: hidden;
}

.component-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        var(--theme-accent-light), 
        transparent);
    animation: loading-shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes loading-shimmer {
    100% {
        left: 100%;
    }
}

.component-error {
    border: 1px solid var(--error-color);
    background: rgba(220, 53, 69, 0.05);
}

.component-success {
    border: 1px solid var(--success-color);
    background: rgba(40, 167, 69, 0.05);
}

.component-warning {
    border: 1px solid var(--warning-color);
    background: rgba(255, 193, 7, 0.05);
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .smooth-transition,
    .bounce-in,
    .slide-in-left,
    .slide-in-right,
    .fade-in {
        animation: none;
        transition: none;
    }
}

@media (prefers-contrast: high) {
    :root {
        --control-bg: #ffffff;
        --panel-bg: #ffffff;
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #000000;
        --control-shadow: 0 0 0 2px #000000;
    }
}

/* Dark mode support (preparado para futuro uso) */
@media (prefers-color-scheme: dark) {
    :root {
        --theme-surface: #1a1a1a;
        --theme-surface-elevated: #2d2d2d;
        --theme-surface-overlay: rgba(45, 45, 45, 0.95);
        
        --theme-on-surface: #ffffff;
        --theme-on-surface-secondary: #cccccc;
        --theme-on-surface-muted: #888888;
        
        --control-bg: rgba(45, 45, 45, 0.95);
        --panel-bg: rgba(45, 45, 45, 0.98);
        --bg-secondary: #2d2d2d;
        --border-color: #444444;
        --border-light: #555555;
    }
    
    body {
        background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    }
}

/* Print styles */
@media print {
    .style-controls,
    .zoom-controls,
    .visualization-controls,
    .editing-controls,
    .size-controls,
    .camera-3d-controls,
    .map-controls,
    .loading-overlay,
    .error-panel {
        display: none;
    }
    
    #map {
        position: static;
        width: 100%;
        height: 500px;
    }
    
    .lot-info-panel {
        position: static;
        float: right;
        margin: 10px;
        width: 200px;
        page-break-inside: avoid;
    }
}

/* Estilos específicos para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .interactive:hover {
        transform: none;
        box-shadow: inherit;
    }
    
    .zoom-btn,
    .style-btn,
    .control-btn {
        min-height: 44px; /* Tamaño mínimo táctil recomendado */
        min-width: 44px;
    }
    
    .size-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    
    .pin-hover-tooltip {
        display: none !important; /* Ocultar tooltips de hover en dispositivos táctiles */
    }
}

/* Optimizaciones de rendimiento */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.optimize-animations {
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contenido específico del tema */
.theme-watermark {
    position: fixed;
    bottom: 10px;
    left: 10px;
    font-size: var(--font-size-xs);
    color: var(--theme-on-surface-muted);
    z-index: var(--z-dropdown);
    opacity: 0.6;
    pointer-events: none;
}

.theme-watermark::after {
    content: 'MAP_POLYGON_PIN_ENHANCED - Tema Default';
}