/*
 Theme Name:   HMO Manager — Bhume Child
 Theme URI:    https://example.com/hmo-bhume
 Description:  HMO Manager Pro child theme based on Bhume Real Estate. Replaces ERE/agency functionality with the HMO Manager Pro plugin. Includes Tenant Portal, Manager Frontend, and CF7 integration.
 Author:       Your Name
 Author URI:   https://example.com
 Template:     bhume
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  hmo-bhume
 Tags:         hmo, property-management, real-estate, uk, tenant-portal
*/

/* ─── Import parent theme styles ───────────────────────────────────────── */
/* Bhume assets are enqueued via wp_enqueue_scripts in functions.php        */

/* ─────────────────────────────────────────────────────────────────────────
   HMO MANAGER — FRONTEND DESIGN SYSTEM
   Inherits Bhume Bootstrap + Swiper. Extends with HMO-specific components.
   ───────────────────────────────────────────────────────────────────────── */

:root {
    /* Bhume primary colour kept for brand continuity */
    --hmo-primary:        #5758D6;
    --hmo-primary-dark:   #3d3eb5;
    --hmo-primary-light:  #eeeef9;
    --hmo-accent:         #FF6B35;
    --hmo-green:          #27ae60;
    --hmo-orange:         #f39c12;
    --hmo-red:            #e74c3c;
    --hmo-blue:           #2980b9;
    --hmo-grey:           #6c757d;
    --hmo-light:          #f8f9fa;
    --hmo-dark:           #1a1a2e;
    --hmo-border:         #e9ecef;
    --hmo-white:          #ffffff;
    --hmo-text:           #2d2d2d;
    --hmo-text-muted:     #6c757d;
    --hmo-radius:         8px;
    --hmo-radius-lg:      16px;
    --hmo-shadow:         0 2px 15px rgba(87,88,214,.08);
    --hmo-shadow-hover:   0 8px 30px rgba(87,88,214,.18);
    --hmo-transition:     all .25s ease;
}

/* ─── Base overrides ────────────────────────────────────────────────────── */
body {
    color: var(--hmo-text);
    font-family: 'Inter', 'Nunito', sans-serif;
}

a { color: var(--hmo-primary); }
a:hover { color: var(--hmo-primary-dark); }

/* ─── Badges ────────────────────────────────────────────────────────────── */
.hmo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}
.hmo-badge--available  { background: #d5f5e3; color: #1e8449; }
.hmo-badge--occupied   { background: #d6eaf8; color: #1a5276; }
.hmo-badge--reserved   { background: #e8daef; color: #6c3483; }
.hmo-badge--maintenance{ background: #fdebd0; color: #935116; }
.hmo-badge--active     { background: #d5f5e3; color: #1e8449; }
.hmo-badge--inactive   { background: #f2f3f4; color: #5d6d7e; }
.hmo-badge--renovation { background: #fdebd0; color: #935116; }

/* ─── Property Cards ─────────────────────────────────────────────────────
   Keeps Bhume card structure (.tp-property-item) but extends for HMO      */
.hmo-property-card {
    background: var(--hmo-white);
    border-radius: var(--hmo-radius-lg);
    overflow: hidden;
    box-shadow: var(--hmo-shadow);
    transition: var(--hmo-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.hmo-property-card:hover {
    box-shadow: var(--hmo-shadow-hover);
    transform: translateY(-4px);
}
.hmo-property-card__thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}
.hmo-property-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.hmo-property-card:hover .hmo-property-card__thumb img {
    transform: scale(1.05);
}
.hmo-property-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}
.hmo-property-card__rooms-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,.65);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}
.hmo-property-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.hmo-property-card__title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}
.hmo-property-card__title a {
    color: var(--hmo-dark);
    text-decoration: none;
}
.hmo-property-card__title a:hover { color: var(--hmo-primary); }
.hmo-property-card__address {
    color: var(--hmo-text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 14px;
}
.hmo-property-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--hmo-border);
    border-bottom: 1px solid var(--hmo-border);
    margin-bottom: 14px;
}
.hmo-property-card__meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--hmo-text-muted);
}
.hmo-property-card__meta-item strong { color: var(--hmo-text); font-weight: 600; }
.hmo-property-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.hmo-property-card__rent {
    font-size: 18px;
    font-weight: 700;
    color: var(--hmo-primary);
}
.hmo-property-card__rent span {
    font-size: 12px;
    font-weight: 400;
    color: var(--hmo-text-muted);
}

/* ─── Room Cards ─────────────────────────────────────────────────────────── */
.hmo-room-card {
    background: var(--hmo-white);
    border-radius: var(--hmo-radius);
    border: 1px solid var(--hmo-border);
    overflow: hidden;
    transition: var(--hmo-transition);
}
.hmo-room-card:hover {
    border-color: var(--hmo-primary);
    box-shadow: var(--hmo-shadow);
}
.hmo-room-card__thumb {
    aspect-ratio: 4/3;
    overflow: hidden;
}
.hmo-room-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.hmo-room-card:hover .hmo-room-card__thumb img { transform: scale(1.04); }
.hmo-room-card__body { padding: 16px; }
.hmo-room-card__title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--hmo-dark);
}
.hmo-room-card__features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.hmo-room-card__feature {
    background: var(--hmo-light);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--hmo-grey);
}
.hmo-room-card__rent {
    font-size: 16px;
    font-weight: 700;
    color: var(--hmo-primary);
}
.hmo-room-card__rent small {
    font-weight: 400;
    font-size: 11px;
    color: var(--hmo-text-muted);
}

/* ─── Archive / listing page ────────────────────────────────────────────── */
.hmo-archive-header {
    background: linear-gradient(135deg, var(--hmo-dark) 0%, var(--hmo-primary-dark) 100%);
    padding: 60px 0;
    color: #fff;
    margin-bottom: 40px;
}
.hmo-archive-header h1 { font-weight: 800; font-size: 36px; }
.hmo-archive-filters {
    background: var(--hmo-white);
    border-radius: var(--hmo-radius-lg);
    padding: 20px 24px;
    box-shadow: var(--hmo-shadow);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.hmo-filter-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.hmo-filter-group label { font-size: 12px; font-weight: 600; color: var(--hmo-text-muted); }
.hmo-filter-group select,
.hmo-filter-group input {
    border: 1px solid var(--hmo-border);
    border-radius: var(--hmo-radius);
    padding: 8px 12px;
    font-size: 14px;
    background: var(--hmo-white);
    transition: var(--hmo-transition);
}
.hmo-filter-group select:focus,
.hmo-filter-group input:focus {
    border-color: var(--hmo-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(87,88,214,.1);
}

/* ─── Single Property ─────────────────────────────────────────────────────
   Keeps Bhume's .tp-property-details-* classes for CSS compat             */
.hmo-single-gallery {
    border-radius: var(--hmo-radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
}
.hmo-single-gallery .swiper-slide img {
    width: 100%;
    height: 420px;
    object-fit: cover;
}
.hmo-detail-section {
    background: var(--hmo-white);
    border-radius: var(--hmo-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hmo-detail-section__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--hmo-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--hmo-primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.hmo-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.hmo-stat-item {
    text-align: center;
    padding: 16px 12px;
    background: var(--hmo-light);
    border-radius: var(--hmo-radius);
}
.hmo-stat-item__value {
    font-size: 22px;
    font-weight: 800;
    color: var(--hmo-primary);
    display: block;
}
.hmo-stat-item__label {
    font-size: 11px;
    color: var(--hmo-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 4px;
    display: block;
}
.hmo-facilities-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.hmo-facility-tag {
    background: var(--hmo-primary-light);
    color: var(--hmo-primary-dark);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Communal gallery grid ─────────────────────────────────────────────── */
.hmo-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.hmo-photo-grid__item {
    border-radius: var(--hmo-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
}
.hmo-photo-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
    cursor: pointer;
}
.hmo-photo-grid__item:hover img { transform: scale(1.04); }

/* ─── Tenant Portal ──────────────────────────────────────────────────────── */
.hmo-portal-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    min-height: 70vh;
    align-items: start;
    padding: 40px 0;
}
.hmo-portal-nav {
    background: var(--hmo-white);
    border-radius: var(--hmo-radius-lg);
    padding: 20px;
    box-shadow: var(--hmo-shadow);
    position: sticky;
    top: 100px;
}
.hmo-portal-nav__user {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hmo-border);
    margin-bottom: 16px;
}
.hmo-portal-nav__avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--hmo-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--hmo-primary);
    margin: 0 auto 10px;
}
.hmo-portal-nav__name { font-weight: 700; font-size: 15px; }
.hmo-portal-nav__room { font-size: 12px; color: var(--hmo-text-muted); }
.hmo-portal-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hmo-portal-nav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--hmo-radius);
    color: var(--hmo-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--hmo-transition);
}
.hmo-portal-nav ul li a:hover,
.hmo-portal-nav ul li a.active {
    background: var(--hmo-primary-light);
    color: var(--hmo-primary);
}
.hmo-portal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.hmo-portal-card {
    background: var(--hmo-white);
    border-radius: var(--hmo-radius-lg);
    padding: 24px;
    box-shadow: var(--hmo-shadow);
}
.hmo-portal-card__title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--hmo-dark);
}
.hmo-tenancy-info dt {
    font-weight: 600;
    font-size: 12px;
    color: var(--hmo-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 12px;
}
.hmo-tenancy-info dd {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 500;
}

/* ─── Form action cards (Check-in, Report Issue, etc.) ─────────────────── */
.hmo-action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.hmo-action-card {
    background: var(--hmo-white);
    border: 2px solid var(--hmo-border);
    border-radius: var(--hmo-radius-lg);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: var(--hmo-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--hmo-text);
}
.hmo-action-card:hover {
    border-color: var(--hmo-primary);
    background: var(--hmo-primary-light);
    color: var(--hmo-primary);
    transform: translateY(-2px);
}
.hmo-action-card__icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    background: var(--hmo-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hmo-action-card__title { font-size: 14px; font-weight: 700; }
.hmo-action-card__desc { font-size: 12px; color: var(--hmo-text-muted); }

/* ─── Manager Frontend Dashboard ────────────────────────────────────────── */
.hmo-manager-wrap {
    padding: 30px 0 60px;
}
.hmo-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}
.hmo-manager-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.hmo-manager-stat {
    background: var(--hmo-white);
    border-radius: var(--hmo-radius-lg);
    padding: 20px;
    box-shadow: var(--hmo-shadow);
    border-left: 4px solid var(--hmo-primary);
}
.hmo-manager-stat--green  { border-color: var(--hmo-green); }
.hmo-manager-stat--orange { border-color: var(--hmo-orange); }
.hmo-manager-stat--red    { border-color: var(--hmo-red); }
.hmo-manager-stat__value  { font-size: 30px; font-weight: 800; color: var(--hmo-dark); }
.hmo-manager-stat__label  { font-size: 12px; color: var(--hmo-text-muted); margin-top: 4px; }

/* ─── Signature pad ──────────────────────────────────────────────────────── */
.hmo-signature-wrap {
    border: 2px dashed var(--hmo-border);
    border-radius: var(--hmo-radius);
    padding: 8px;
    background: var(--hmo-light);
}
#hmo-signature-canvas {
    width: 100%;
    height: 160px;
    display: block;
    background: var(--hmo-white);
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
}
.hmo-signature-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ─── Auth forms (onboarding, login) ────────────────────────────────────── */
.hmo-auth-wrap {
    max-width: 560px;
    margin: 60px auto;
    background: var(--hmo-white);
    border-radius: var(--hmo-radius-lg);
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0,0,0,.1);
}
.hmo-auth-wrap h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--hmo-dark);
}
.hmo-auth-wrap .hmo-auth-subtitle {
    color: var(--hmo-text-muted);
    margin-bottom: 28px;
    font-size: 14px;
}
.hmo-form-group { margin-bottom: 18px; }
.hmo-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--hmo-text);
}
.hmo-form-group label .hmo-required { color: var(--hmo-red); margin-left: 2px; }
.hmo-form-control {
    width: 100%;
    border: 1px solid var(--hmo-border);
    border-radius: var(--hmo-radius);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--hmo-transition);
    background: var(--hmo-white);
}
.hmo-form-control:focus {
    border-color: var(--hmo-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(87,88,214,.12);
}
.hmo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--hmo-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--hmo-transition);
    text-decoration: none;
    line-height: 1;
}
.hmo-btn--primary {
    background: var(--hmo-primary);
    color: #fff;
    border-color: var(--hmo-primary);
}
.hmo-btn--primary:hover {
    background: var(--hmo-primary-dark);
    border-color: var(--hmo-primary-dark);
    color: #fff;
}
.hmo-btn--outline {
    background: transparent;
    color: var(--hmo-primary);
    border-color: var(--hmo-primary);
}
.hmo-btn--outline:hover {
    background: var(--hmo-primary);
    color: #fff;
}
.hmo-btn--danger {
    background: var(--hmo-red);
    color: #fff;
    border-color: var(--hmo-red);
}
.hmo-btn--sm { padding: 7px 14px; font-size: 12px; }
.hmo-btn--full { width: 100%; }

/* ─── Step progress (onboarding form) ──────────────────────────────────── */
.hmo-steps {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 0;
}
.hmo-step {
    flex: 1;
    text-align: center;
    position: relative;
}
.hmo-step::after {
    content: '';
    position: absolute;
    top: 16px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--hmo-border);
    z-index: 0;
}
.hmo-step:last-child::after { display: none; }
.hmo-step__dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hmo-border);
    color: var(--hmo-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin: 0 auto 6px;
    position: relative;
    z-index: 1;
    transition: var(--hmo-transition);
}
.hmo-step--active .hmo-step__dot  { background: var(--hmo-primary); color: #fff; }
.hmo-step--done .hmo-step__dot    { background: var(--hmo-green); color: #fff; }
.hmo-step__label { font-size: 11px; color: var(--hmo-text-muted); font-weight: 500; }
.hmo-step--active .hmo-step__label { color: var(--hmo-primary); font-weight: 700; }

/* ─── Alerts & notices ──────────────────────────────────────────────────── */
.hmo-alert {
    padding: 12px 16px;
    border-radius: var(--hmo-radius);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 4px solid;
}
.hmo-alert--success { background: #d5f5e3; border-color: var(--hmo-green); color: #1e8449; }
.hmo-alert--error   { background: #fadbd8; border-color: var(--hmo-red);   color: #922b21; }
.hmo-alert--info    { background: #d6eaf8; border-color: var(--hmo-blue);  color: #1a5276; }
.hmo-alert--warning { background: #fef9e7; border-color: var(--hmo-orange);color: #784212; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .hmo-portal-wrap {
        grid-template-columns: 1fr;
    }
    .hmo-portal-nav {
        position: static;
    }
    .hmo-portal-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
    }
}
@media (max-width: 767px) {
    .hmo-single-gallery .swiper-slide img { height: 240px; }
    .hmo-auth-wrap { padding: 24px 16px; margin: 30px auto; }
    .hmo-archive-header h1 { font-size: 26px; }
    .hmo-archive-filters { flex-direction: column; }
}
