:root {
    --primary: #FF8800;
    --primary-hover: #E67A00;
    --secondary: #1E293B;
    --accent: #FF8800;
    /* Usamos naranja para resaltar elementos activos */
    --bg-main: #F8FAFC;
    --sidebar-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    height: 100vh;
    overflow: hidden;
}

#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* SIDEBAR */
#sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    z-index: 100;
}

.sidebar-header {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 700;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-main);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: #F1F5F9;
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
}

/* MAIN CONTENT */
#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.view {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.view.active {
    display: flex;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 10px;
}

#map {
    flex: 1;
    width: 100%;
}

.content-scroll {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

/* COMPONENTS */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
}

.btn-maxi {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-maxi:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary i {
    width: 16px;
}

/* FORM */
.form-container {
    width: 100%;
    max-width: 600px;
    padding: 30px;
}

.form-container h3 {
    margin-bottom: 10px;
}

.form-container p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.form-group textarea {
    height: 120px;
    resize: none;
}

/* CHATBOT */
#chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    z-index: 1000;
}

#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 136, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
}

#chat-window {
    width: 350px;
    height: 450px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-window.hidden {
    display: none;
}

.chat-header {
    padding: 15px 20px;
    background: var(--accent);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

#close-chat {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.msg.bot {
    background: #F1F5F9;
    align-self: flex-start;
}

.msg.user {
    background: var(--accent);
    color: white;
    align-self: flex-end;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 20px;
    outline: none;
}

.chat-input-area button {
    background: var(--accent);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
}

/* STATUS MAPA */
#status-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
}

#status-card {
    padding: 8px 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* CUSTOM MARKER */
.custom-pin {
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-pin {
    z-index: 1000;
    border-color: white;
}

.pin-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
    animation: pinPulse 2s infinite;
}

@keyframes pinPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* MODALES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: all 0.3s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    width: 90%;
    max-width: 450px;
    padding: 0;
    overflow: hidden;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    max-width: 80%;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.filter-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    border-bottom: 1px solid #f8fafc;
}

.filter-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border);
}

.w-full {
    width: 100%;
}

/* SWITCH TOGGLE (ESTILO ISO) */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E2E8F0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: #34C759;
}

input:focus+.slider {
    box-shadow: 0 0 1px #34C759;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.loading-filters {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.offer-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.offer-card:hover {
    border-color: var(--primary);
    background: white;
}

.offer-card h4 {
    color: var(--primary);
    margin-bottom: 5px;
}

.offer-card .offer-puesto {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    margin-bottom: 5px;
}

.offer-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* AUTHENTICATION SYSTEM */
.hidden {
    display: none !important;
}

body.auth-active {
    overflow: hidden;
}

#auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 136, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 136, 0, 0.03) 0%, transparent 50%);
    z-index: -1;
}

.auth-card {
    max-width: 440px;
    width: 100%;
    padding: 50px 40px;
    text-align: center;
    animation: fadeInScale 0.4s ease-out;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-logo {
    height: 45px;
    margin-bottom: 24px;
}

.auth-header {
    margin-bottom: 35px;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 8px;
    font-weight: 700;
}

.auth-header p {
    color: #64748b;
    font-size: 0.95rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 20px;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-google:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.btn-google img {
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    padding: 0 15px;
}

.auth-card .form-group {
    text-align: left;
    margin-bottom: 22px;
}

.auth-card label {
    display: block;
    font-size: 0.8rem;
    color: #FF8800;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.2s ease;
}

.auth-card input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b !important;
    padding: 14px 14px 14px 44px;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.auth-card input:focus {
    border-color: #FF8800;
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.1);
}

.auth-card input:focus+i,
.auth-card input:not(:placeholder-shown)+i {
    color: #FF8800;
}

#login-view,
#register-view {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#login-view.hidden,
#register-view.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

/* Autofill Fix for Light Themes */
.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1e293b !important;
    -webkit-box-shadow: 0 0 0px 1000px #f8fafc inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-footer {
    margin-top: 40px;
    font-size: 0.95rem;
    color: #64748b;
}

.auth-footer a {
    color: #FF8800;
    font-weight: 700;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Transitions */
#auth-container.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease;
    pointer-events: none;
}

.copyright-text {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

.sidebar-footer .copyright-text {
    text-align: left;
    margin-left: 0;
    opacity: 0.7;
}

/* RESPONSIVIDAD MÓVIL (MAX-WIDTH: 768px) */
@media (max-width: 768px) {
    #app-container {
        flex-direction: column;
        overflow-y: auto;
    }

    #sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 10px 0;
        flex-shrink: 0;
    }

    .sidebar-header {
        padding: 5px 20px 10px 20px;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
        gap: 10px;
    }

    .nav-item {
        white-space: nowrap;
        padding: 8px 15px;
    }

    .sidebar-footer {
        display: none;
    }

    #main-content {
        height: auto;
        min-height: calc(100vh - 120px);
    }

    .auth-card {
        padding: 30px 20px;
        min-height: auto;
        width: 100%;
        margin: 10px;
    }

    .view-header {
        padding: 10px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .content-scroll {
        padding: 20px;
    }
}