/* ============================================================
   PLACE2CARE — Premium Design System v4.0
   ============================================================ */

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes bounceSoft {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-8px);}
    60% {transform: translateY(-4px);}
}

@keyframes pulseOpacity {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-40px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ============================================================
   HOUSE CARD PREMIUM (for Alerts)
   ============================================================ */
.house-card-premium {
    background: white;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.house-card-premium:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border-color: #cbd5e1;
}

.house-card-premium.partial-match {
    border: 1px solid #fbcfe8;
}

.house-card-premium.partial-match:hover {
    border-color: #f472b6;
    box-shadow: 0 25px 50px -12px rgba(236, 72, 153, 0.15);
}

.adv-tag-premium {
    background: #f8fafc;
    color: #475569;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.adv-tag-premium.adv-tag-cantou {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fdba74;
}

.adv-tag-premium.adv-tag-shortstay {
    background: #f5f3ff;
    color: #5b21b6;
    border-color: #ddd6fe;
    font-size: 0.68rem;
    padding: 3px 9px;
    white-space: nowrap;
    pointer-events: none;
    text-transform: none;
}

:root {
    /* Core palette */
    --primary-color: #0c4a6e;
    --primary-dark: #07304a;
    --primary-light: #0369a1;
    --primary-mid: #1e40af;
    --accent-color: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.35);
    --secondary-color: #f59e0b;
    --danger-color: #ef4444;

    /* Backgrounds */
    --background-color: #f0f4f8;
    --background-gradient: linear-gradient(145deg, #e8f0fe 0%, #f0f4f8 50%, #e8f5f0 100%);
    --card-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Text */
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;

    /* Borders */
    --border-color: #e2e8f0;
    --border-focus: #0ea5e9;

    /* Shadows — elevated & layered */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
    --shadow-xl: 0 30px 60px rgba(0,0,0,0.18), 0 12px 24px rgba(0,0,0,0.08);
    --shadow-card-hover: 0 24px 48px rgba(12, 74, 110, 0.2), 0 8px 16px rgba(12, 74, 110, 0.1);
    --shadow-glow: 0 0 0 3px var(--accent-glow);

    /* Shape */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Motion */
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   HEADER — Animated mesh gradient + glassmorphism
   ============================================================ */
.app-header {
    background: linear-gradient(160deg, #0a1628 0%, #0c2461 55%, #1a3a6e 100%);
    color: white;
    padding: 1.2rem 2rem 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Orbs - very subtle depth hints */
.app-header::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 65%);
    top: -250px;
    left: -150px;
    pointer-events: none;
}

.app-header::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.07) 0%, transparent 65%);
    bottom: -150px;
    right: -80px;
    pointer-events: none;
}

/* Extra decorative orbs injected by HTML - kept minimal/hidden */
.header-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}
.header-orb-1, .header-orb-2 { display: none; }

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Logo */
.logo-container {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    transition: var(--transition);
    flex-shrink: 0;
}

.logo-container:hover {
    transform: scale(1.08) rotate(-3deg);
}

.app-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.25)) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    border-radius: 12px;
}

/* Title */
#main-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin: 0;
    letter-spacing: -0.03em;
    color: white;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.brand {
    font-weight: 800;
    display: inline-flex;
    align-items: center;
}

.brand-place {
    color: white;
}

.brand-2care {
    color: #10b981;
}

.region-title {
    color: white;
    font-weight: 600;
}

@keyframes shimmerText {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.brand-logo {
    display: none;
}

/* Total badge */
#total-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.3rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0.25rem 0 0.25rem 0.75rem;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(16,185,129,0.5), 0 0 0 2px rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.25);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(16,185,129,0.35), 0 0 0 2px rgba(255,255,255,0.15); }
    50%       { box-shadow: 0 4px 18px rgba(16,185,129,0.5), 0 0 0 4px rgba(16,185,129,0.2); }
}

/* Subtitle */
#main-subtitle {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.88;
    max-width: 520px;
    text-align: center;
    margin-top: 0.5rem;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 8px rgba(0,0,0,0.2);
}

.logo-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.logo-title-row:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.3rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: var(--transition-fast);
    backdrop-filter: blur(8px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.35);
}

.lang-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(16,185,129,0.4);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255,255,255,0.9);
    padding: 0.55rem 1.5rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: normal;
    position: relative;
    overflow: hidden;
}

.nav-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    color: white;
}

.nav-btn:hover::after {
    opacity: 1;
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
    color: var(--primary-color);
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.5);
}

.nav-selector {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.nav-selector:hover {
    background-color: rgba(255, 255, 255, 0.22);
    border-color: rgba(255,255,255,0.35);
}

.nav-selector option {
    background: #0f172a;
    color: white;
    font-weight: 500;
}

/* Notification badge on nav buttons */
.notification-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    margin-left: 4px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(239,68,68,0.5);
    animation: notifShake 3s ease-in-out infinite;
}

@keyframes notifShake {
    0%, 85%, 100% { transform: translateX(0); }
    88%  { transform: translateX(-2px) rotate(-5deg); }
    91%  { transform: translateX(2px) rotate(5deg); }
    94%  { transform: translateX(-2px) rotate(-3deg); }
    97%  { transform: translateX(1px) rotate(2deg); }
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
#view-container {
    flex: 1;
    max-width: 1120px;
    margin: -2rem auto 3rem auto;
    width: 92%;
    z-index: 10;
    animation: pageEntrance 0.5s ease-out;
}

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

/* ============================================================
   HOME CONTROLS — Glassmorphism floating bar
   ============================================================ */
/* ============================================================
   SHARED GLASS HEADER (Home, Favorites, Alerts)
   ============================================================ */
.glass-header-bar, .home-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 110;
    margin: 0 0 1.25rem 0;
    padding: 0 1.25rem;
    height: 64px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.6);
    flex-wrap: nowrap;
    gap: 0.75rem;
    animation: fadeIn 0.4s ease-out;
    box-sizing: border-box;
    overflow: visible; /* FIXED: Allow children like the onboarding bubble to overflow */
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary-color);
    opacity: 0.75;
    white-space: nowrap;
}

.btn-pill {
    background: white;
    border: 1.5px solid #dde4ee;
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-pill:hover {
    background: #f0f6ff;
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12,74,110,0.12);
}

.btn-pill.active.cantou {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    border-color: #f59e0b;
    box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}

.btn-pill.active.revalidation {
    background: linear-gradient(135deg, #1e40af, #0d47a1);
    color: white;
    border-color: #1e40af;
    box-shadow: 0 4px 14px rgba(29,64,175,0.35);
}

.btn-pill.active.shortstay {
    background: linear-gradient(135deg, #5b21b6, #4c1d95);
    color: white;
    border-color: #5b21b6;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.btn-pill.active.sort {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(12,74,110,0.3);
}

/* Search clear buttons */
#clear-search:hover,
#clear-price:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    transform: translateY(-50%) scale(1.1);
}

#clear-search:active,
#clear-price:active {
    transform: translateY(-50%) scale(0.95);
}

/* Price input */
#max-price-filter::-webkit-inner-spin-button,
#max-price-filter::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#max-price-filter {
    -moz-appearance: textfield;
    appearance: none;
}

#max-price-filter:focus {
    border-color: #f59e0b !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.2);
    transform: scale(1.01);
}

#max-price-filter::placeholder {
    color: #92400e;
    font-weight: 500;
    opacity: 0.5;
}

/* ============================================================
   CARDS GRID
   ============================================================ */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

/* Staggered entrance animation for cards */
.home-grid .house-card:nth-child(1)  { animation-delay: 0.05s; }
.home-grid .house-card:nth-child(2)  { animation-delay: 0.10s; }
.home-grid .house-card:nth-child(3)  { animation-delay: 0.15s; }
.home-grid .house-card:nth-child(4)  { animation-delay: 0.20s; }
.home-grid .house-card:nth-child(5)  { animation-delay: 0.25s; }
.home-grid .house-card:nth-child(6)  { animation-delay: 0.30s; }
.home-grid .house-card:nth-child(7)  { animation-delay: 0.35s; }
.home-grid .house-card:nth-child(8)  { animation-delay: 0.40s; }
.home-grid .house-card:nth-child(n+9) { animation-delay: 0.45s; }

/* ============================================================
   HOUSE CARD
   ============================================================ */
.house-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.35s ease, border-color 0.25s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: visible; /* FIXED: Allow badges to pop out while maintaining rounding durability */
    isolation: isolate;
    backface-visibility: hidden;
    transform-style: preserve-3d; /* Helps with border-radius clipping during scale */
    display: flex;
    flex-direction: column;
    animation: cardEntrance 0.5s ease-out both;
}

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

.house-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(14,165,233,0) 0%, rgba(16,185,129,0) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 0;
}

.house-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(14, 165, 233, 0.4);
}

.house-card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(14,165,233,0.04) 0%, rgba(16,185,129,0.04) 100%);
}

.house-card.non-partner {
    border-left: 4px solid #94a3b8;
    background: #fafafa;
    cursor: default;
    opacity: 0.82;
}

.house-card.non-partner:hover {
    transform: none;
    box-shadow: var(--shadow-md);
    border-color: #94a3b8;
}

.house-card.rare-opportunity {
    border: 2px solid #f59e0b;
    box-shadow: 0 10px 30px -10px rgba(245, 158, 11, 0.4);
    background: linear-gradient(to bottom, #fffcf5 0%, #ffffff 100%);
}

.house-card.rare-opportunity:hover {
    box-shadow: 0 20px 40px -12px rgba(245, 158, 11, 0.5);
    transform: translateY(-12px) scale(1.02);
}

.adv-tag-rare {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: none !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.65rem !important;
    padding: 5px 12px !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    border-radius: 50px;
    white-space: nowrap;
}

.adv-tag-rare.floating-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
}

/* Card image */
.house-card-image-box {
    width: 100%;
    height: 185px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #dde3ea 0%, #c8d6e5 100%);
    border-bottom: 1px solid var(--border-color);
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.house-card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4,0,0.2,1), opacity 0.5s ease;
    border-radius: inherit;
}

.house-card:hover .house-card-image-box img {
    transform: scale(1.08);
}

/* Card body */
.house-card-body {
    padding: 1rem 1.25rem 1.3rem;
    flex: 1;
    position: relative;
    z-index: 1;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.house-card h2 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    margin-bottom: 0.6rem;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.house-card .availability-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* Photo badge */
.photo-count-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Service badge */
.service-badge {
    background: linear-gradient(135deg, rgba(14,165,233,0.12), rgba(99,102,241,0.08));
    color: #0369a1;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid rgba(14,165,233,0.25);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* Staff tags */
.house-staff-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.staff-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    letter-spacing: 0.01em;
    transition: var(--transition-fast);
}

.staff-tag.partenamut {
    background: linear-gradient(135deg, #0D47A1, #1565C0) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(13,71,161,0.3);
}

/* Favourite button */
.btn-favorite {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    color: #cbd5e1;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    z-index: 5;
    box-shadow: var(--shadow-sm);
}

.btn-favorite:hover {
    transform: scale(1.2);
    color: #ef4444;
    border-color: #fecaca;
    background: white;
    box-shadow: 0 4px 16px rgba(239,68,68,0.25);
}

.btn-favorite.active {
    color: #ef4444;
    background: #fff1f2;
    border-color: #fecaca;
    box-shadow: 0 4px 16px rgba(239,68,68,0.2);
}

.btn-favorite.active svg {
    fill: currentColor;
}

/* ============================================================
   STATUS DOTS — with animated pulse for available
   ============================================================ */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.status-dot.available {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 0 0 4px rgba(16,185,129,0.15);
}

.status-dot.available::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(16,185,129,0.3);
    animation: statusPulse 2s ease-out infinite;
}

@keyframes statusPulse {
    0%   { transform: scale(0.7); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
}

.status-dot.limited {
    background-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 0 0 4px rgba(245,158,11,0.15);
}

.status-dot.full {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 0 0 4px rgba(239,68,68,0.1);
}

/* ============================================================
   LOADER — Premium shimmer
   ============================================================ */
.loader {
    text-align: center;
    padding: 4rem;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader::before {
    content: '';
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent-color);
    border-right-color: var(--primary-color);
    animation: spinLoader 0.8s linear infinite;
}

@keyframes spinLoader {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   ADVANTAGES TAGS
   ============================================================ */
.advantages-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.adv-tag {
    background: linear-gradient(135deg, #f0f7ff, #e8f4fd);
    color: var(--primary-light);
    font-size: 0.68rem;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(3, 105, 161, 0.2);
    font-weight: 600;
    transition: var(--transition-fast);
}

.adv-tag:hover {
    background: linear-gradient(135deg, #e0f0ff, #d0e8fa);
    border-color: var(--primary-light);
}

.adv-tag-cantou {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    color: #78350f !important;
    border-color: #f59e0b !important;
    font-weight: 700;
}

.admin-adv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f8fafc;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* ============================================================
   DETAILS VIEW
   ============================================================ */
.details-view {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.4s ease-out;
    border: 1px solid rgba(255,255,255,0.8);
}

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

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

/* Room table */
.room-table {
    width: 100%;
    border-collapse: collapse;
}

.room-table th,
.room-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.room-table th {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.room-table tr:hover {
    background: #f8fbff;
}

.room-table tr:hover td {
    color: var(--primary-color);
}

.room-table tr.selected-row {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border-left: 4px solid var(--primary-color);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 11px 26px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(12,74,110,0.3);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(12,74,110,0.4);
    background: linear-gradient(135deg, var(--primary-light), #0ea5e9);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid #dde4ee;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f0f6ff;
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(12,74,110,0.12);
    transform: translateY(-2px);
}

.btn-delete-small {
    background: #fff1f2;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.btn-delete-small:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

/* Loading spinner in buttons */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: rotate-spinner 0.75s linear infinite;
}

@keyframes rotate-spinner {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Checkbox */
.custom-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

/* Actions bar */
.actions-bar {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* ============================================================
   ADMIN STYLES
   ============================================================ */
.admin-login {
    max-width: 420px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255,255,255,0.8);
    animation: fadeSlideUp 0.5s ease-out;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.room-table input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    background: #fafbfc;
    color: var(--text-main);
}

.form-group input:focus,
.room-table input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: white;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Password Visibility Toggle */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    padding-right: 40px !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 5;
}

.password-toggle:hover {
    color: var(--primary-light);
    transform: scale(1.1);
}

/* Admin house accordion */
.admin-house-accordion {
    margin-bottom: 2.5rem;
}

.admin-house-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.admin-house-summary:hover {
    border-color: var(--primary-light);
    background: #f8fbff;
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.admin-house-summary h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 700;
}

.admin-house-summary .house-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Update Badge on Cards */
.update-badge {
    position: relative;
    z-index: 10;
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
    white-space: nowrap;
    width: fit-content;
    animation: fadeInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.new-badge {
    background: #059669; /* Emerald 600 */
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.rented-badge {
    background: #f59e0b; /* Amber 600 */
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8) translateY(-5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.admin-house-summary .house-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.admin-house-summary.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f7ff, #f8fbff);
}

.admin-house-details {
    border: 1.5px solid var(--primary-color);
    border-top: none;
    padding: 2rem;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    background: white;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.chevron-icon {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--primary-color);
}

.expanded .chevron-icon {
    transform: rotate(180deg);
}

.admin-staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.8rem;
}

.admin-house-section {
    animation: fadeSlideUp 0.4s ease-out;
}

.admin-house-section:nth-child(even) {
    background-color: #f8fafc !important;
}

.admin-house-section:nth-child(odd) {
    background-color: #ffffff !important;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.btn-photo {
    background: linear-gradient(135deg, #f1f5f9, #e8edf5);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    margin: 0 auto;
}

.btn-photo:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12,74,110,0.25);
    border-color: transparent;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.lightbox-container {
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafc, white);
}

.lightbox-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--primary-color);
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    color: var(--text-muted);
    transition: var(--transition-fast);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox-close:hover {
    color: #ef4444;
    background: #fff1f2;
}

/* Room thumbnail */
.room-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1.5px solid var(--border-color);
    transition: var(--transition-fast);
    display: block;
    margin: 0 auto;
}

.room-thumb:hover {
    transform: scale(1.12);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

/* ============================================================
   BADGES & SPECIAL TAGS
   ============================================================ */
.requested-tag {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #c2410c;
    border: 1px solid #fdba74;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Rare opportunity badge */
.rare-badge {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    border: 1px solid #f59e0b;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 8px rgba(245,158,11,0.25);
}

/* ============================================================
   SEARCH ONBOARDING TOOLTIP
   ============================================================ */

.btn-search-help {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    color: #475569;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-search-help:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.search-onboarding-bubble {
    position: absolute;
    top: calc(100% + 12px);
    right: -10px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    animation: bubble-bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: top right;
    width: 320px;
}

@keyframes bubble-bounce {
    0% { opacity: 0; transform: translateY(-10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.bubble-arrow {
    position: absolute;
    top: -8px;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(255, 255, 255, 0.98);
}

.bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.bubble-header span {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bubble-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.bubble-close:hover {
    color: #ef4444;
}

.bubble-content {
    font-size: 0.825rem;
    line-height: 1.5;
    color: #475569;
    margin-bottom: 1rem;
}

.bubble-content b {
    color: var(--primary-color);
    font-weight: 700;
}

.bubble-content i {
    background: #f1f5f9;
    padding: 0 4px;
    border-radius: 4px;
    font-style: normal;
    color: var(--primary-color);
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 700;
}

.bubble-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-bubble-confirm {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-bubble-confirm:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 48, 74, 0.3);
}

@media (max-width: 640px) {
    .search-onboarding-bubble {
        width: 280px;
        right: -10px;
    }
}

.adv-tag-shortstay {
    background: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    text-transform: none;
    letter-spacing: normal;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
    white-space: nowrap;
    pointer-events: none;
}

/* Base header controls layout refinement */
.home-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    z-index: 110;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .home-controls {
        justify-content: center;
    }
}

/* ============================================================
   ALERT CARDS
   ============================================================ */
/* --- Alerts Layout --- */
.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.alert-card {
    background: white;
    border-radius: 20px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    animation: fadeSlideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.alert-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-5px);
}

.alert-card.has-matches {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #f0fdf8, white);
}

.alert-criteria-tag {
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    margin-right: 0.5rem;
    border: 1px solid #e2e8f0;
    font-weight: 500;
}

.btn-delete-alert {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #fff1f2;
    color: #ef4444;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-delete-alert:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
    transform: scale(1.1);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalEntrance 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

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

/* ============================================================
   PHOTO HOVER PREVIEW
   ============================================================ */
.photo-hover-preview {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    cursor: help;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.photo-hover-preview:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.photo-hover-preview .preview-img {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 12px;
    width: 240px;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: 4px solid white;
    z-index: 100;
    pointer-events: none;
    animation: fadeSlideUp 0.25s ease-out;
}

.photo-hover-preview:hover .preview-img {
    display: block;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* ============================================================
   GLOBAL ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 768px) {
    .app-header {
        padding: 1.75rem 1.25rem 3rem;
    }

    #main-title {
        font-size: 1.6rem;
    }

    nav {
        gap: 0.5rem;
    }

    .nav-btn {
        padding: 0.45rem 1.1rem;
        font-size: 0.82rem;
    }

    #view-container {
        width: 95%;
        margin-top: -1.5rem;
    }

    .home-controls {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .home-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .details-view {
        padding: 1.25rem;
    }

    .room-table-container {
        overflow-x: auto;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    #main-title {
        font-size: 1.4rem;
    }

    .home-controls {
        padding: 0.75rem 1rem;
    }

    .logo-title-row {
        gap: 0.4rem;
    }
}

/* --- Custom Searchable Dropdown --- */
.search-dropdown-container {
    position: relative;
    width: 100%;
}

.search-dropdown-input {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    padding: 0 1rem;
    font-family: inherit;
    font-size: 1rem;
    background: white;
    transition: var(--transition-fast);
}

.search-dropdown-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 74, 110, 0.1);
    outline: none;
}

.search-dropdown-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    max-height: 250px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.search-dropdown-results.active {
    display: block;
}

.search-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
    border-bottom: 1px solid #f8fafc;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.search-dropdown-item.no-results {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

/* --- Stats Calendar --- */
.stats-calendar-container {
    background: white;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    max-width: 450px; /* 🚀 More compact */
}

.stats-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px; /* Smaller gap */
    margin-top: 0.75rem;
}

.stats-calendar-day-header {
    text-align: center;
    font-size: 0.65rem; /* Smaller font */
    font-weight: 700;
    color: var(--text-muted);
    padding-bottom: 6px;
    text-transform: uppercase;
}

.stats-calendar-cell {
    aspect-ratio: 1 / 1;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #f8fafc;
    transition: var(--transition-fast);
}

.stats-calendar-cell:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.calendar-day-num {
    font-size: 0.65rem; /* Smaller font */
    font-weight: 600;
    color: var(--text-muted);
}

.calendar-day-count {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 800;
    color: #0891b2; /* 🚀 Cyan/Teal for better visibility */
}

.calendar-day-count.empty {
    color: #cbd5e1;
    font-weight: 400;
    font-size: 0.7rem;
}

.stats-calendar-cell.today {
    border: 1.5px solid var(--accent-color);
    background: #f0fdf4;
}

.stats-calendar-cell.best-day {
    background: #ecfeff;
    border: 1.5px solid #0891b2;
    box-shadow: 0 0 10px rgba(8, 145, 178, 0.2);
}

.stats-calendar-cell.best-day .calendar-day-count {
    color: #0e7490;
    transform: scale(1.1);
}

.stats-calendar-cell.outside-month {
    opacity: 0.2;
    pointer-events: none;
}

/* ============================================================
   CHATBOT WIDGET
   ============================================================ */
.chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-mid));
    color: white;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 32px rgba(12, 74, 110, 0.4), var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
    outline: none;
    position: absolute;
    bottom: 0;
    right: 0;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 28px rgba(12, 74, 110, 0.4);
}

.chatbot-toggle-btn.open {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chatbot-window {
    width: 350px;
    height: 500px;
    max-height: 80vh;
    max-width: 90vw;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    right: 0;
    transform-origin: bottom right;
    animation: chatEntrance 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border: 1px solid var(--border-color);
}

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

@keyframes chatExit {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.8) translateY(20px); pointer-events: none; }
}

.chatbot-window.closing {
    animation: chatExit 0.25s ease-in forwards;
}

.chatbot-header {
    background: linear-gradient(135deg, #0a1628, var(--primary-color));
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    line-height: 1.2;
}

.chatbot-status {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    display: block;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close-btn:hover {
    opacity: 1;
}

.chatbot-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: #fdfdfd;
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(12, 74, 110, 0.03) 0px, transparent 50%);
}

.chat-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.chat-message.bot {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: var(--shadow-sm);
}

.chat-message.user {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-mid));
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    box-shadow: 0 4px 12px rgba(12, 74, 110, 0.25);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
    align-self: flex-start;
    align-items: center;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease-out;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chatbot-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    align-items: center;
}

#chatbot-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition-fast);
}

#chatbot-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.chatbot-link {
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
    transition: opacity 0.2s;
}

.chatbot-link:hover {
    opacity: 0.8;
}

.chatbot-send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.chatbot-send-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.chatbot-send-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   FEEDBACK SYSTEM (Bugs/Suggestions/Comments)
   ============================================================ */
.feedback-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition-bounce);
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.25);
    opacity: 0.7;
}

.feedback-fab:hover {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: var(--shadow-lg);
    background: var(--primary-light);
}

.feedback-fab svg {
    width: 22px;
    height: 22px;
    transition: var(--transition);
}

.feedback-fab:hover svg {
    transform: rotate(5deg);
}

/* Feedback Modal Specifics */
.feedback-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 8px;
}

.feedback-option:hover {
    background: #f1f5f9;
    border-color: var(--primary-light);
}

.feedback-option.active {
    background: #eff6ff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

.feedback-option input {
    display: none;
}

.feedback-option .dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.feedback-option.active .dot {
    border-color: var(--primary-light);
    background: white;
}

.feedback-option .dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-light);
    transform: scale(0);
    transition: var(--transition-fast);
}

.feedback-option.active .dot::after {
    transform: scale(1);
}

.feedback-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-top: 1rem;
    transition: var(--transition-fast);
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(3, 105, 161, 0.1);
}

/* ———————— SLIDE-TO-VERIFY (CAPTCHA) ———————— */
.captcha-slider-track {
    position: relative;
    height: 52px;
    background: #f1f5f9;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 1.5px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    user-select: none;
    transition: all 0.3s ease;
}

.captcha-slider-track.dragging {
    background: #f8fafc;
    border-color: var(--primary-light);
}

.captcha-slider-track.verified {
    background: #f0fdf4;
    border-color: #22c55e;
}

.captcha-slider-handle {
    position: absolute;
    left: 6px;
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: grab;
    z-index: 10;
    transition: background 0.3s ease, color 0.3s ease;
}

.captcha-slider-handle:active {
    cursor: grabbing;
}

.captcha-slider-track.verified .captcha-slider-handle {
    background: #22c55e;
    color: white;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.captcha-slider-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #94a3b8;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.captcha-slider-track.verified .captcha-slider-text {
    color: #166534;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

.btn-primary.ready {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 10px 20px rgba(3, 105, 161, 0.3);
}

/* ———————— INSTRUCTION MODAL (MAIL) ———————— */
.instruction-modal {
    max-width: 440px !important;
    text-align: center;
    padding: 2.5rem !important;
    border-radius: 24px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.instruction-icon-wrapper {
    width: 70px;
    height: 70px;
    background: #ecfdf5;
    color: #10b981;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    transform: rotate(-3deg);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.15);
}

.instruction-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.instruction-text {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.keyboard-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    color: #334155;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 0 2px;
}

.instruction-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.instruction-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    color: #94a3b8;
    transition: color 0.2s;
}

.instruction-checkbox-container:hover {
    color: #64748b;
}

.instruction-checkbox-container input {
    cursor: pointer;
    accent-color: #10b981;
}

.patient-name-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #f1f5f9;
    border-radius: 14px;
    font-size: 1.05rem;
    color: #1e293b;
    margin-bottom: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.patient-name-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(160deg, #0a1628 0%, #0c2461 55%, #1a3a6e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    animation: fadeScaleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeScaleIn {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-logo-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.splash-logo {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.4));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.splash-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    color: white;
}

.splash-brand .brand-place { color: white; }
.splash-brand .brand-2care { color: #10b981; }

.splash-loader {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    position: relative;
}

.loader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
    animation: loaderProgress 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes loaderProgress {
    0% { width: 0; }
    30% { width: 40%; }
    60% { width: 75%; }
    100% { width: 100%; }
}

#splash-status {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
