/* ═══════════════════════════════════════════
   Hotel Management System — Frontend Styles
═══════════════════════════════════════════ */

/* Reset */
.hms-frontend * { box-sizing: border-box; }

/* Room Grid */
.hms-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* Room Card */
.hms-room-card-front {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}
.hms-room-card-front:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.hms-room-img-wrap {
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hms-room-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.hms-room-placeholder { font-size: 64px; }

.hms-room-info { padding: 20px; }

.hms-room-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #1a1a2e;
}
.hms-room-num {
    font-size: 0.8rem;
    color: #888;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 20px;
}

.hms-room-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    font-size: 0.85rem;
    color: #555;
}

.hms-room-desc {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 8px 0;
}

.hms-amenities { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.hms-amenity-tag {
    background: #e8f4ff;
    color: #2563eb;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

.hms-room-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.hms-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
}
.hms-price small { font-size: 0.75rem; font-weight: 400; color: #888; }

.hms-btn-check {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}
.hms-btn-check:hover { background: #1d4ed8; }

/* ── Modal ── */
.hms-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.hms-modal-overlay[style*="none"] { display: none !important; }

.hms-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: hmsSlideIn 0.3s ease;
}
@keyframes hmsSlideIn {
    from { opacity:0; transform:translateY(-20px); }
    to   { opacity:1; transform:translateY(0); }
}

.hms-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: #f0f0f0;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
}

.hms-modal-box h2 { margin: 0 0 20px; color: #1a1a2e; }

/* Form Elements */
.hms-form-group { margin-bottom: 14px; }
.hms-form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.85rem; color: #444; }
.hms-form-group input,
.hms-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.hms-form-group input:focus,
.hms-form-group textarea:focus { border-color: #2563eb; outline: none; }

.hms-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Buttons */
.hms-btn-primary {
    width: 100%;
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}
.hms-btn-primary:hover { background: #1d4ed8; }

.hms-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.hms-btn-secondary:hover { background: #e0e0e0; }

.hms-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Messages */
.hms-msg {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.9rem;
    font-weight: 500;
}
.hms-msg-error   { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.hms-msg-success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }
.hms-msg-warning { background: #fef3c7; color: #d97706; border: 1px solid #fcd34d; }

/* Available Banner */
.hms-available-banner {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

/* Summary Box */
.hms-summary-box {
    background: #f8faff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.hms-summary-box .hms-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}
.hms-summary-box .hms-summary-row:last-child { border: none; font-weight: 700; font-size: 1rem; }

/* Success */
.hms-success-wrap { text-align: center; padding: 20px 0; }
.hms-success-icon { font-size: 64px; margin-bottom: 16px; }
.hms-booking-ref { background: #f0f0f0; padding: 10px; border-radius: 8px; font-weight: 600; }

/* Responsive */
@media (max-width: 600px) {
    .hms-rooms-grid { grid-template-columns: 1fr; }
    .hms-form-row-2 { grid-template-columns: 1fr; }
}

/* Shortcode emoji/icon size guard */
.hms-frontend img.emoji,
.hms-frontend img.wp-smiley,
.hms-staff-login img.emoji,
.hms-staff-denied img.emoji {
    display: inline-block !important;
    width: 1em !important;
    height: 1em !important;
    max-width: 1em !important;
    max-height: 1em !important;
    margin: 0 0.08em !important;
    vertical-align: -0.12em !important;
    object-fit: contain !important;
    box-shadow: none !important;
    border: 0 !important;
}

.hms-frontend .hms-room-placeholder,
.hms-frontend .hms-success-icon {
    line-height: 1 !important;
}
.hms-frontend .hms-room-placeholder img.emoji,
.hms-frontend .hms-success-icon img.emoji {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
}


/* Room multi-image carousel */
.hms-room-carousel { position: relative; }
.hms-room-carousel .hms-room-slide { display: none; width: 100%; height: 100%; object-fit: cover; }
.hms-room-carousel .hms-room-slide.is-active { display: block; }
.hms-room-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.75);
    background: rgba(15,23,42,.35);
    color: #fff;
    font-size: 24px;
    line-height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.hms-room-arrow:hover { background: rgba(15,23,42,.65); }
.hms-room-arrow-left { left: 10px; }
.hms-room-arrow-right { right: 10px; }
