/*
========================================
TYPE SELECTION - ESTILOS
========================================
Archivo: app/static/css/type_selection.css
Descripción: Estilos para la página de selección de tipo de propiedad
             Soporta los 3 temas: default, nocturno, futurista
========================================
*/

/* ===========================================
   ESTILOS BASE - TEMA DEFAULT (Claro)
   Fondo blanco opaco, tarjetas blancas, iconos/texto azul
   =========================================== */

.type-selection-page {
    min-height: 100vh;
    padding: 15px 0;
    background: var(--tema-fondo-cuerpo, #f5f7fa);
}

.type-selection-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 12px;
}

.type-selection-page h2 {
    color: var(--tema-primario, var(--tema-primario, #1e90ff));
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 5px;
}

.property-types-grid {
    margin-top: 10px;
}

/* MÓVIL: Grid 3 columnas con tarjetas compactas */
.property-types-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.property-type-card {
    background: var(--tema-fondo-tarjeta, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(var(--tema-primario-rgb, 30, 144, 255), 0.12);
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    width: 100%;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--tema-borde-color, rgba(var(--tema-primario-rgb, 30, 144, 255), 0.15));
    padding: 10px 6px;
}

.property-type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(var(--tema-primario-rgb, 30, 144, 255), 0.2);
    border-color: var(--tema-borde-hover, rgba(var(--tema-primario-rgb, 30, 144, 255), 0.4));
}

.property-type-card:active {
    transform: scale(0.96);
}

.property-type-card.selected {
    transform: scale(0.97);
    box-shadow: 0 0 0 3px var(--tema-primario, var(--tema-primario, #1e90ff));
    border: 2px solid var(--tema-primario, var(--tema-primario, #1e90ff));
    background: var(--tema-fondo-activo, rgba(var(--tema-primario-rgb, 30, 144, 255), 0.05));
}

.btn-property-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 6px 4px;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-property-type i {
    font-size: 1.4rem;
    color: var(--tema-primario, var(--tema-primario, #1e90ff)) !important;
    margin-bottom: 3px;
}

.btn-property-type span {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--tema-primario, var(--tema-primario, #1e90ff)) !important;
    line-height: 1.15;
    word-wrap: break-word;
    max-width: 100%;
}

/* Forzar colores en tema claro */
:root .btn-property-type i,
:root .btn-property-type span,
[data-tema="default"] .btn-property-type i,
[data-tema="default"] .btn-property-type span {
    color: var(--tema-primario, #1e90ff) !important;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 15px;
}

.flash-messages .alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.flash-messages .alert-danger {
    background-color: #ffeef0;
    color: #c0392b;
    border: 1px solid rgba(192, 57, 43, 0.2);
}

.flash-messages .alert-success {
    background-color: #eafaf1;
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

/* ===========================================
   TABLETS (480px - 767px): 3 columnas mejoradas
   =========================================== */
@media (min-width: 480px) and (max-width: 767px) {
    .property-types-form {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .property-type-card {
        min-height: 95px;
        padding: 12px 8px;
    }
    
    .btn-property-type i {
        font-size: 1.6rem;
    }
    
    .btn-property-type span {
        font-size: 0.72rem;
    }
    
    .type-selection-page h2 {
        font-size: 1.4rem;
        margin-bottom: 25px;
    }
}

/* ===========================================
   DESKTOP (768px+): Grid 4 columnas
   =========================================== */
@media (min-width: 768px) {
    .type-selection-page {
        padding: 40px 0;
    }
    
    .type-selection-page .container {
        padding: 20px 30px;
    }
    
    .type-selection-page h2 {
        font-size: 2rem;
        margin-bottom: 35px;
        margin-top: 15px;
    }
    
    .property-types-grid {
        margin-top: 20px;
    }
    
    .property-types-form {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        margin-top: 30px;
    }
    
    .property-type-card {
        min-height: 130px;
        padding: 20px 12px;
        border-radius: 16px;
    }
    
    .property-type-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 30px rgba(var(--tema-primario-rgb, 30, 144, 255), 0.25);
    }
    
    .btn-property-type {
        gap: 8px;
        padding: 12px 8px;
    }
    
    .btn-property-type i {
        font-size: 2.2rem;
        margin-bottom: 6px;
    }
    
    .btn-property-type span {
        font-size: 0.95rem;
    }
}

/* ===========================================
   DESKTOP GRANDE (1200px+): 6 columnas
   =========================================== */
@media (min-width: 1200px) {
    .type-selection-page .container {
        max-width: 1400px;
    }
    
    .property-types-form {
        grid-template-columns: repeat(6, 1fr);
        gap: 18px;
    }
    
    .property-type-card {
        min-height: 140px;
        padding: 22px 14px;
    }
    
    .btn-property-type i {
        font-size: 2.5rem;
    }
    
    .btn-property-type span {
        font-size: 1rem;
    }
    
    .type-selection-page h2 {
        font-size: 2.2rem;
        margin-bottom: 40px;
    }
}

/* ===========================================
   TEMA NOCTURNO
   =========================================== */
[data-tema="nocturno"] .type-selection-page {
    background: transparent;
}

[data-tema="nocturno"] .type-selection-page h2 {
    color: #4fc3f7;
}

[data-tema="nocturno"] .property-type-card {
    background: #1a1f2e;
    border: 1px solid rgba(79, 195, 247, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-tema="nocturno"] .property-type-card:hover {
    background: #242a3d;
    border-color: rgba(79, 195, 247, 0.5);
    box-shadow: 0 8px 25px rgba(79, 195, 247, 0.2);
}

[data-tema="nocturno"] .property-type-card.selected {
    border: 2px solid #4fc3f7;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
}

[data-tema="nocturno"] .btn-property-type i {
    color: #4fc3f7;
}

[data-tema="nocturno"] .btn-property-type span {
    color: #e6edf3;
}

[data-tema="nocturno"] .flash-messages .alert {
    background: var(--tema-fondo-tarjeta);
    border: 1px solid var(--tema-borde-color);
    color: var(--tema-texto-primario);
}

[data-tema="futurista"] .flash-messages .alert {
    background: var(--tema-fondo-panel);
    border: 1px solid var(--tema-borde-color);
    color: var(--tema-texto-primario);
}

/* ===========================================
   TEMA FUTURISTA
   =========================================== */
[data-tema="futurista"] .type-selection-page,
[data-tema="futurista"] .type-selection-page .container,
[data-tema="futurista"] .property-types-grid,
[data-tema="futurista"] .property-types-form {
    background: transparent;
    background-color: transparent;
    background-image: none;
}

[data-tema="futurista"] .type-selection-page h2 {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(0, 247, 255, 0.6);
    -webkit-text-stroke: 1px rgba(0, 247, 255, 0.5);
}

[data-tema="futurista"] .property-type-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 247, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.15);
}

[data-tema="futurista"] .property-type-card:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(0, 247, 255, 0.7);
    box-shadow: 0 0 35px rgba(0, 247, 255, 0.4);
    transform: translateY(-6px);
}

[data-tema="futurista"] .property-type-card.selected {
    border: 2px solid rgba(0, 247, 255, 0.9);
    box-shadow: 0 0 40px rgba(0, 247, 255, 0.5);
}

[data-tema="futurista"] .btn-property-type i {
    color: #00f7ff;
    text-shadow: 0 0 15px rgba(0, 247, 255, 0.6);
}

[data-tema="futurista"] .btn-property-type span {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 247, 255, 0.4);
}

/* Flash messages en futurista */
[data-tema="futurista"] .flash-messages .alert {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 247, 255, 0.3);
    color: #ffffff;
}

[data-tema="futurista"] .flash-messages .alert-danger {
    border-color: rgba(255, 0, 100, 0.5);
}

[data-tema="futurista"] .flash-messages .alert-success {
    border-color: rgba(0, 255, 136, 0.5);
}

/* ===========================================
   ESTILOS DE SELECCIÓN Y BOTÓN CONTINUAR
   =========================================== */
.property-type-checkbox {
    position: relative;
    display: block;
}

.property-type-checkbox input:checked + .btn-property-type {
    border-color: var(--tema-primario, #1e90ff) !important;
    background: var(--tema-primario-transparente, rgba(30, 144, 255, 0.15)) !important;
    box-shadow: 0 0 0 3px rgba(var(--tema-primario-rgb, 30, 144, 255), 0.25);
    transform: scale(1.02);
}

.property-type-checkbox input:checked + .btn-property-type::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    color: var(--tema-exito, #28a745);
    font-weight: bold;
    font-size: 1.2rem;
}

.selection-info {
    background: var(--tema-primario-transparente, rgba(30, 144, 255, 0.1));
    border: 1px solid rgba(var(--tema-primario-rgb, 30, 144, 255), 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.selection-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-types-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.type-badge {
    background: var(--tema-primario, #1e90ff);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Botón continuar - RESPONSIVO */
.btn-continuar {
    background: var(--tema-gradiente-primario, linear-gradient(135deg, #1e90ff, #00d4ff));
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    min-width: 200px;
    max-width: 300px;
}

.btn-continuar:disabled {
    background: var(--tema-texto-silenciado, #6c757d);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-continuar:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 144, 255, 0.4);
}

/* Responsividad para móviles */
@media (max-width: 576px) {
    .selection-info-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-continuar {
        width: 100%;
        max-width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .type-selection-page .container {
        padding: 10px 8px;
    }
    
    .type-selection-page h2 {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .property-types-form {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .property-type-card {
        min-height: 70px;
        padding: 8px 4px;
    }
    
    .btn-property-type i {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    
    .btn-property-type span {
        font-size: 0.55rem;
    }
}

/* Tabletas */
@media (min-width: 577px) and (max-width: 991px) {
    .btn-continuar {
        width: auto;
        padding: 12px 25px;
    }
}
