/* ============================================================
   ROOMIE EXPRESS — style.css
   Tema: Blanco limpio · Azul (#2563EB) · Naranja (#F97316)
   Fuente: Plus Jakarta Sans
   ============================================================ */

:root {
    --blue:        #2563EB;
    --blue-mid:    #3B82F6;
    --blue-light:  #EFF6FF;
    --blue-dark:   #1D4ED8;
    --orange:      #F97316;
    --orange-light:#FFF7ED;
    --orange-dark: #EA580C;
    --white:       #FFFFFF;
    --gray-50:     #F9FAFB;
    --gray-100:    #F3F4F6;
    --gray-200:    #E5E7EB;
    --gray-400:    #9CA3AF;
    --gray-500:    #6B7280;
    --gray-700:    #374151;
    --gray-900:    #111827;
    --green:       #059669;
    --red:         #DC2626;
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
    --radius:      14px;
    --radius-sm:   8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--gray-50);
    color: var(--gray-900);
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    overflow-x: hidden;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Decorative top stripe */
body::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--blue), var(--orange));
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}

.container {
    width: 100vw;
    max-width: 450px;
    margin: 0 auto;
    padding: 20px 16px 16px;
}

/* ============================================================
   BIENVENIDA
   ============================================================ */
.brand-container {
    padding: 36px 0 24px;
    text-align: center;
}

.main-logo {
    width: 90px;
    height: 90px;
    border-radius: 22px;
    border: 3px solid var(--blue);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.18);
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.app-name {
    color: var(--blue);
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.app-tagline {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 6px;
    font-weight: 500;
}

.welcome-box {
    background: var(--white);
    border-radius: 20px;
    border: 1px solid var(--gray-200);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
}

#legal-text-box {
    color: var(--gray-500);
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 22px;
}

#legal-text-box b { color: var(--blue); }

.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================================
   BOTONES PRINCIPALES
   ============================================================ */
.btn-main {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--blue), var(--blue-mid));
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: transform 0.1s, box-shadow 0.1s;
    font-family: 'Plus Jakarta Sans', sans-serif;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-main:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
    background: transparent;
    color: var(--blue);
    border: 1.5px solid var(--blue);
    padding: 12px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.82rem;
    cursor: pointer;
    display: block;
    text-align: center;
}

/* ============================================================
   REGISTRO
   ============================================================ */
.brand-container-small {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 0 16px;
}

.mini-logo-reg {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid var(--blue);
}

.app-name-small {
    color: var(--blue);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.form-reg {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 40px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 13px 14px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    color: var(--gray-900);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: border-color 0.15s;
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input::placeholder { color: var(--gray-400); }
select { color: var(--gray-700); }

.field-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 600;
    margin-top: 4px;
    margin-left: 2px;
    letter-spacing: 0.2px;
}

/* Tipo Toggle */
.tipo-toggle-container {
    margin-top: 6px;
}

.field-label-main {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.tipo-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tipo-btn {
    padding: 14px 8px;
    border: 2px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.18s;
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-align: center;
    line-height: 1.4;
}

.tipo-btn.active {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Sección form */
.tipo-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 4px;
}

.section-subtitle {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 4px;
}

/* Fotos Upload */
.fotos-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

.foto-upload-label {
    display: block;
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 2px dashed var(--gray-200);
    background: var(--gray-50);
    transition: border-color 0.15s;
}

.foto-upload-label:hover { border-color: var(--blue); }

.foto-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 4px;
}

.foto-icon { font-size: 1.6rem; }
.foto-txt  { font-size: 0.68rem; color: var(--gray-400); font-weight: 600; text-align: center; line-height: 1.3; }

.foto-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Personalidad */
.personalidad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pers-btn {
    padding: 10px 8px;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.15s;
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-align: center;
}

.pers-btn.active {
    border-color: var(--orange);
    background: var(--orange-light);
    color: var(--orange-dark);
}

/* ============================================================
   BANNER DE SESIÓN
   ============================================================ */
#session-banner {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    padding: 10px 14px 12px;
    margin-bottom: 14px;
    transition: border-color 0.4s;
    box-shadow: var(--shadow-sm);
}

#session-banner.warning { border-color: var(--orange); }
#session-banner.urgent  { border-color: var(--red); animation: pulse-border 1.5s infinite; }

@keyframes pulse-border {
    0%, 100% { border-color: var(--red); }
    50%       { border-color: #F87171; }
}

.session-banner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.72rem;
}

#session-icon  { font-size: 0.9rem; }
#session-label { color: var(--gray-500); flex: 1; margin-left: 6px; font-weight: 500; }
#session-time  { font-weight: 800; color: var(--blue); font-size: 0.82rem; }

#session-banner.warning #session-time { color: var(--orange); }
#session-banner.urgent  #session-time { color: var(--red); }

.session-bar-bg {
    width: 100%;
    height: 4px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

#session-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--blue);
    transition: width 1s linear, background 0.5s;
}

#session-banner.warning #session-bar-fill { background: var(--orange); }
#session-banner.urgent  #session-bar-fill { background: var(--red); }

/* ============================================================
   RADAR — HEADER & MENU
   ============================================================ */
.header-radar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 2px solid var(--blue);
}

.app-name-mini {
    color: var(--blue);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.btn-reset {
    background: none;
    border: 1.5px solid var(--gray-200);
    color: var(--red);
    font-weight: 700;
    font-size: 0.68rem;
    cursor: pointer;
    border-radius: 6px;
    padding: 5px 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-install-header {
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 6px 10px;
    font-weight: 700;
    font-size: 0.68rem;
    cursor: pointer;
    animation: pulse-install 2.5s infinite;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

@keyframes pulse-install {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.75; }
}

/* Tabs */
.radar-menu {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

.btn-menu {
    flex: 1;
    padding: 9px 2px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-weight: 700;
    font-size: 0.58rem;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.btn-menu.active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.30);
}

.btn-menu.notif-match {
    background: var(--red) !important;
    color: #fff !important;
    animation: pulse-notif 1.2s infinite;
}

@keyframes pulse-notif {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.8; }
}

/* Filtros */
.radar-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    padding: 10px 14px;
}

.dist-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-weight: 600;
    white-space: nowrap;
}

.dist-val-highlight {
    color: var(--blue);
    font-weight: 800;
}

.dist-slider {
    flex: 1;
    accent-color: var(--blue);
    height: 4px;
}

/* ============================================================
   GRIDS Y CARDS
   ============================================================ */
.radar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-bottom: 40px;
}

.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--blue);
    font-weight: 700;
    font-size: 0.88rem;
    animation: pulse-empty 2s infinite;
}

@keyframes pulse-empty {
    0%, 100% { opacity: 0.45; }
    50%       { opacity: 0.9; }
}

/* Card base */
.profile-card {
    background: var(--white);
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.15s;
}

.profile-card:active {
    transform: scale(0.98);
}

/* Room photo area (Ofrezco cards) */
.card-photo-area {
    width: 100%;
    height: 120px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.card-photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-count-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Avatar area (Busco cards) */
.card-avatar-area {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-light), #DBEAFE);
    flex-shrink: 0;
}

.card-avatar-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    border: 3px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

/* Card info */
.profile-card-info {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-card-info h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-price {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--blue);
}

.card-budget {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--orange);
}

.card-meta {
    font-size: 0.68rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tags */
.card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.57rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.card-tag.blue   { background: rgba(37,99,235,0.10); color: var(--blue); border: 1px solid rgba(37,99,235,0.2); }
.card-tag.orange { background: rgba(249,115,22,0.10); color: var(--orange-dark); border: 1px solid rgba(249,115,22,0.2); }
.card-tag.green  { background: rgba(5,150,105,0.10); color: var(--green); border: 1px solid rgba(5,150,105,0.2); }
.card-tag.gray   { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); }

/* Botones de acción en cards */
.btn-interesado {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    border: none;
    border-radius: 7px;
    font-weight: 700;
    font-size: 0.66rem;
    cursor: pointer;
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    box-shadow: 0 3px 10px rgba(249,115,22,0.30);
    transition: transform 0.1s;
}

.btn-interesado:active { transform: scale(0.97); }

.btn-interesado:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    box-shadow: none;
    cursor: default;
}

.btn-chat-card {
    width: 100%;
    padding: 8px;
    background: var(--blue-light);
    color: var(--blue);
    border: 1.5px solid var(--blue);
    border-radius: 7px;
    font-size: 0.66rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.15s;
}

.btn-chat-card.btn-msg-notif {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.btn-wait-card {
    width: 100%;
    padding: 8px;
    background: var(--gray-100);
    color: var(--gray-400);
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    font-size: 0.66rem;
    font-weight: 700;
    cursor: default;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ============================================================
   CHAT
   ============================================================ */
#screen-chat {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.chat-header {
    padding: 14px 16px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border-bottom: 1.5px solid var(--gray-200);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.btn-back {
    position: absolute;
    left: 14px;
    top: 14px;
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 22px;
    cursor: pointer;
}

.btn-report-header {
    position: absolute;
    right: 14px;
    top: 14px;
    background: none;
    border: 1.5px solid var(--red);
    color: var(--red);
    border-radius: 7px;
    padding: 4px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

#chat-partner-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--blue);
}

#chat-partner-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
}

#chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 90px;
}

.msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
}

.msg.me {
    align-self: flex-end;
    background: var(--blue);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg.them {
    align-self: flex-start;
    background: var(--white);
    color: var(--gray-900);
    border: 1.5px solid var(--gray-200);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: 12px 14px;
    display: flex;
    gap: 8px;
    background: var(--white);
    align-items: center;
    border-top: 1.5px solid var(--gray-200);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}

#chat-input[contenteditable] {
    flex: 1;
    padding: 11px 14px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    color: var(--gray-900);
    border-radius: 10px;
    font-size: 14px;
    min-height: 44px;
    max-height: 100px;
    overflow-y: auto;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

#chat-input[contenteditable]:focus {
    border-color: var(--blue);
}

#chat-input[contenteditable]:empty::before {
    content: attr(data-placeholder);
    color: var(--gray-400);
    pointer-events: none;
}

#chat-char-count {
    font-size: 0.68rem;
    color: var(--gray-400);
    min-width: 26px;
    text-align: center;
    font-weight: 600;
}

#btn-send-msg {
    background: var(--blue);
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.1s;
}

#btn-send-msg:active { transform: scale(0.95); }

/* ============================================================
   MODAL REPORTE
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal-box {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 20px;
    padding: 24px 20px;
    width: 100%;
    max-width: 360px;
    animation: modal-in 0.2s ease;
    box-shadow: var(--shadow-md);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#report-modal-title    { font-size: 1rem; font-weight: 800; margin-bottom: 4px; color: var(--gray-900); }
#report-modal-subtitle { font-size: 0.78rem; color: var(--gray-500); margin-bottom: 16px; }

.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.report-reason-btn {
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    color: var(--gray-700);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: left;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
}

.report-reason-btn.selected {
    border-color: var(--red);
    color: var(--red);
    background: #FFF1F2;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-modal-cancel {
    flex: 1;
    padding: 12px;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    color: var(--gray-500);
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-modal-confirm {
    flex: 1;
    padding: 12px;
    background: var(--red);
    border: none;
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-modal-confirm:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    cursor: default;
}

/* ============================================================
   NOTIFICACIONES
   ============================================================ */
.toast-notif {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: var(--gray-900);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 600;
    z-index: 8000;
    transition: transform 0.3s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.toast-notif.show {
    transform: translateX(-50%) translateY(0);
}
