:root {
    --bg-color: #0b0f19;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #0ea5e9;
    --accent-secondary: #10b981;
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Mesh Background */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15) 0%, transparent 50%);
    filter: blur(60px);
    animation: meshFlow 20s infinite alternate ease-in-out;
}

@keyframes meshFlow {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    transition: all 0.5s ease;
}

.hero.compact {
    min-height: 20vh;
    padding-top: 1rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
}

/* Glassmorphism Search Box */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 800px;
    padding: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.4);
}

.input-group {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 1.5rem;
    gap: 1rem;
}

.input-group .icon {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.input-group:focus-within .icon {
    color: var(--accent-primary);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.1rem;
    width: 100%;
    padding: 1rem 0;
}

.search-box input::placeholder {
    color: #475569;
}

.divider {
    width: 1px;
    height: 40px;
    background: var(--glass-border);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #3b82f6);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 0 2rem;
    height: 56px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Filters */
.filters {
    margin-top: 1.5rem;
    display: flex;
    gap: 2rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
}

.toggle-switch input {
    display: none;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: 0.3s;
    border: 1px solid var(--glass-border);
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
    background-color: white;
}

.label-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.toggle-switch input:checked ~ .label-text {
    color: var(--text-primary);
}

/* Results Area */
.hidden {
    display: none !important;
}

.results-section {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.results-header h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.2rem;
}

/* View Toggles */
.view-toggles {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem;
    border-radius: 12px;
}
.view-toggles button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}
.view-toggles button.active {
    background: var(--accent-primary);
    color: white;
}

/* Map Container */
.map-container {
    height: 600px;
    width: 100%;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
    z-index: 1; /* Para Leaflet */
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
}
.btn-secondary {
    background: rgba(30, 41, 59, 0.6);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 0 2rem;
    height: 50px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--accent-primary);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Result Card */
.card {
    padding: 1.5rem;
    border-radius: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(30, 41, 59, 0.6);
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

.card-scian {
    font-size: 0.85rem;
    color: var(--accent-primary);
    background: rgba(14, 165, 233, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 500;
}

.card-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.card-detail svg {
    flex-shrink: 0;
    width: 16px; height: 16px;
    margin-top: 2px;
}

/* Enlaces interactivos en las tarjetas */
a.card-detail {
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

a.hover-link:hover {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        border-radius: 16px;
        padding: 1rem;
    }
    
    .divider {
        width: 100%;
        height: 1px;
        margin: 0.5rem 0;
    }
    
    .btn-primary {
        width: 100%;
        margin-top: 1rem;
    }
    
    .logo {
        font-size: 3rem;
    }
}
