/* EmailSystem Rentals — Calendar & Booking Form Styles */

.esrentals-wrap,
.esrentals-booking-wrap {
    font-family: inherit;
    max-width: 800px;
    margin: 1.5rem 0;
}

.esrentals-title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

/* ── Legend ────────────────────────────────────────────────────────── */

.esrentals-legend {
    display: flex;
    gap: 1.2rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    align-items: center;
}

.esrentals-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 4px;
}

.esrentals-dot.available  { background: #4caf50; }
.esrentals-dot.booked     { background: #e53935; }
.esrentals-dot.temp_hold  { background: #fb8c00; }
.esrentals-dot.blocked    { background: #bdbdbd; }

/* ── Calendars container ────────────────────────────────────────────── */

.esrentals-calendars {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.esrentals-loading {
    color: #888;
    font-style: italic;
}

/* ── Month grid ─────────────────────────────────────────────────────── */

.esrentals-month-grid {
    min-width: 260px;
}

.esrentals-month-header {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    text-align: center;
}

.esrentals-day-names,
.esrentals-day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.esrentals-day-names span {
    text-align: center;
    font-size: 0.72rem;
    color: #666;
    padding: 2px 0;
}

.esrentals-day {
    text-align: center;
    padding: 5px 2px;
    font-size: 0.82rem;
    border-radius: 4px;
    cursor: default;
    user-select: none;
}

.esrentals-day.empty      { background: transparent !important; }
.esrentals-day.past       { background: transparent !important; color: #bbb !important; }
.esrentals-day.available  { background: #e8f5e9 !important; color: #2e7d32 !important; }
.esrentals-day.booked     { background: #e53935 !important; color: #fff !important; }
.esrentals-day.temp_hold  { background: #fb8c00 !important; color: #fff !important; }
.esrentals-day.blocked    { background: #bdbdbd !important; color: #fff !important; }

.esrentals-day[data-clickable="true"] {
    cursor: pointer;
    font-weight: bold;
}

.esrentals-day[data-clickable="true"]:hover {
    background: #a5d6a7;
    transform: scale(1.1);
    transition: transform 0.1s;
}

/* ── Navigation ─────────────────────────────────────────────────────── */

.esrentals-nav {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.esrentals-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}

.esrentals-btn:hover {
    background: #f0f0f0;
}

.esrentals-notice {
    font-size: 0.82rem;
    color: #555;
    margin-top: 0.5rem;
    font-style: italic;
}

/* ── Min nights note (below calendar grid) ──────────────────────────── */

.esrentals-min-nights-note {
    font-size: 0.78rem;
    color: #555;
    margin: 0.35rem 0 0;
    font-style: italic;
}

/* ── Unit info panel (populated by JS after slug resolution) ─────────── */

.esrentals-unit-info {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.65rem 1rem;
    margin-bottom: 0.85rem;
}

.esrentals-unit-info-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
}

.esrentals-unit-name {
    font-weight: 700;
    font-size: 1rem;
}

.esrentals-unit-meta {
    font-size: 0.82rem;
    color: #555;
}

/* ── Resolving / error states ────────────────────────────────────────── */

.esrentals-resolving {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.esrentals-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #2e7d32;
    border-radius: 50%;
    animation: esrentals-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.esrentals-resolve-error {
    margin-bottom: 0.75rem;
}

/* ── Nights + price preview ─────────────────────────────────────────── */

.esrentals-nights-display {
    font-size: 0.85rem;
    color: #555;
    margin-top: -0.25rem;
    margin-bottom: 0.25rem;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    display: inline-block;
}

/* ── Form status (next to submit button) ────────────────────────────── */

.esrentals-form-status {
    font-size: 0.82rem;
    color: #555;
    margin-left: 0.5rem;
    font-style: italic;
    vertical-align: middle;
}

/* ── Booking form ───────────────────────────────────────────────────── */

.esrentals-hold-notice {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
}

.esrentals-booking-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.esrentals-field-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.esrentals-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 180px;
}

.esrentals-field label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.required { color: #e53935; }

.esrentals-field input,
.esrentals-field textarea {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.esrentals-submit-btn {
    padding: 10px 24px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    align-self: flex-start;
}

.esrentals-submit-btn:hover   { background: #1b5e20; }
.esrentals-submit-btn:disabled { background: #9e9e9e; cursor: not-allowed; }

.esrentals-form-msg {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.esrentals-form-msg.esrentals-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ── Success message ────────────────────────────────────────────────── */

.esrentals-success-msg {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 1rem 1.2rem;
}

.esrentals-success-msg h4 {
    margin: 0 0 0.4rem;
    color: #2e7d32;
}

.esrentals-error {
    color: #e53935;
    font-size: 0.85rem;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .esrentals-field-row {
        flex-direction: column;
    }
    .esrentals-calendars {
        flex-direction: column;
    }
}
