﻿/* =====================================================
   PRESUPUESTAR - MARKETPLACE PÚBLICO
   Estética: dark theme, glass morphism, gradientes indigo
   ===================================================== */

/* =====================================================
   BASE STYLES — Variables y clases compartidas de Landing
   (independientes de Style_Index.css)
   ===================================================== */
:root {
    --dark-bg: #0f0f23;
    --darker-bg: #0a0a1a;
    --primary-color: #6366f1;
    --border-radius: 16px;
    --border-radius-lg: 20px;
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Navbar glass */
.glass-nav {
    background: rgba(15, 15, 35, 0.85) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

    .glass-nav .nav-link {
        color: rgba(255, 255, 255, 0.8) !important;
        font-weight: 500;
        transition: color 0.3s;
    }

        .glass-nav .nav-link:hover,
        .glass-nav .nav-link.active {
            color: #fff !important;
        }

/* Hero background animado */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.25) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.2) 0%, transparent 50%), radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    z-index: 1;
    animation: bgMove 25s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(20px, -15px);
    }

    66% {
        transform: translate(-15px, 10px);
    }
}

/* Hero title */
.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Pulse animation */
@keyframes subtlePulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

/* Badge en hero */
.presupuestar-hero .badge {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #a78bfa !important;
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* ===================
   RESPONSIVE BASE
=================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem !important;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.8rem !important;
    }
}

/* ===================
   HERO
=================== */
.presupuestar-hero {
    min-height: 55vh;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    padding-top: 100px;
    padding-bottom: 0;
}

/* ===================
   SECCIONES
=================== */
.section-modulos,
.section-ubicacion,
.section-resultados {
    background: var(--darker-bg, #0a0a1a);
    position: relative;
}

.section-ubicacion {
    background: var(--dark-bg);
}

/* Step badge */
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    margin-right: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ===================
   MÓDULO CARDS
=================== */
.modulo-select-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

    .modulo-select-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
        opacity: 0;
        transition: opacity 0.3s;
    }

    .modulo-select-card:hover {
        transform: translateY(-8px);
        border-color: rgba(99, 102, 241, 0.4);
        box-shadow: 0 15px 40px rgba(99, 102, 241, 0.2);
    }

        .modulo-select-card:hover::before {
            opacity: 1;
        }

    .modulo-select-card.selected {
        border-color: #6366f1;
        background: rgba(99, 102, 241, 0.15);
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    }

        .modulo-select-card.selected::before {
            opacity: 1;
        }

.modulo-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #a78bfa;
    transition: all 0.3s;
}

.modulo-select-card:hover .modulo-icon,
.modulo-select-card.selected .modulo-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    transform: scale(1.1);
}

.modulo-nombre {
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modulo-tipo-badge {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================
   UBICACIÓN
=================== */
.ubicacion-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.glass-input {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-radius: 12px !important;
    font-size: 1rem;
}

    .glass-input::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }

    .glass-input:focus {
        background: rgba(255, 255, 255, 0.12) !important;
        border-color: #6366f1 !important;
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.2) !important;
    }

/* Autocomplete dropdown público */
.autocomplete-dropdown-pub {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #1e1e3a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

    .autocomplete-dropdown-pub.show {
        display: block;
    }

    .autocomplete-dropdown-pub .autocomplete-item {
        padding: 10px 14px;
        cursor: pointer;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transition: background 0.15s;
        color: #e5e7eb;
        font-size: 0.9rem;
    }

        .autocomplete-dropdown-pub .autocomplete-item:hover {
            background: rgba(99, 102, 241, 0.2);
        }

        .autocomplete-dropdown-pub .autocomplete-item i {
            color: #8b5cf6;
            margin-right: 8px;
        }

    .autocomplete-dropdown-pub .autocomplete-detail {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.4);
        margin-top: 2px;
    }

    .autocomplete-dropdown-pub .autocomplete-loading {
        padding: 12px;
        text-align: center;
        color: rgba(255, 255, 255, 0.4);
        font-size: 0.85rem;
    }

/* ===================
   MAPA Y RESULTADOS
=================== */
.mapa-container-pub {
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.empresas-lista {
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

    /* Scrollbar estilizado */
    .empresas-lista::-webkit-scrollbar {
        width: 6px;
    }

    .empresas-lista::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 3px;
    }

    .empresas-lista::-webkit-scrollbar-thumb {
        background: rgba(99, 102, 241, 0.4);
        border-radius: 3px;
    }

/* Empresa card */
.empresa-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
}

    .empresa-card:hover {
        background: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.4);
        transform: translateX(4px);
    }

.empresa-logo-container {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

    .empresa-logo-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.empresa-logo-placeholder {
    font-size: 1.5rem;
    color: #6366f1;
}

.empresa-info {
    flex: 1;
    min-width: 0;
}

.empresa-nombre {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empresa-ubicacion {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 2px;
}

.empresa-distancia {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

.empresa-acciones {
    flex-shrink: 0;
}

.btn-presupuestar {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
}

    .btn-presupuestar:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
        color: #fff;
    }

/* Botón CTA principal */
.btn-presupuestar-ahora {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 12px 28px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    transition: all 0.3s;
    animation: subtlePulse 3s infinite;
}

    .btn-presupuestar-ahora:hover {
        transform: scale(1.05);
        box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5);
        color: #fff;
    }

/* Sin resultados */
.sin-resultados {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.5);
}

    .sin-resultados i {
        font-size: 3rem;
        color: rgba(99, 102, 241, 0.3);
        margin-bottom: 1rem;
    }

/* ===================
   MARCADORES MAPA CUSTOM
=================== */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Fix badge ubicación — texto visible */
#ubicacionInfo .badge {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

    #ubicacionInfo .badge i {
        color: #34d399;
    }

.marker-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

    .marker-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.marker-default {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Fix popup mapa — textos y botones visibles */
.leaflet-popup-content-wrapper {
    background: #fff !important;
    color: #1f2937 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

.leaflet-popup-tip {
    background: #fff !important;
}

.leaflet-popup-content a.btn {
    color: #fff !important;
    text-decoration: none;
}

.leaflet-popup-content strong {
    color: #1f2937;
}

.leaflet-popup-content small {
    color: #6b7280;
}

.leaflet-popup-content .text-primary {
    color: #6366f1 !important;
}

.marker-user {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
    animation: pulseUser 2s infinite;
}

@keyframes pulseUser {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
    }
}

/* ===================
   FOOTER MINI
=================== */
.footer-mini {
    background: var(--darker-bg, #0a0a1a);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ===================
   RESPONSIVE
=================== */
@media (max-width: 768px) {
    .presupuestar-hero {
        min-height: 40vh;
        padding-top: 100px;
    }

        .presupuestar-hero .display-3 {
            font-size: 2rem !important;
        }

    .modulo-select-card {
        padding: 1.2rem 1rem;
    }

    .modulo-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .modulo-nombre {
        font-size: 0.9rem;
    }

    .mapa-container-pub #mapaResultados {
        height: 300px !important;
    }

    .empresa-card {
        flex-wrap: wrap;
    }

    .btn-presupuestar-ahora {
        font-size: 0.9rem;
        padding: 10px 20px;
    }

    .section-resultados .d-flex {
        flex-direction: column;
        gap: 12px;
    }
}
