/* =========================================================
   ระบบจองห้อง — Traveloka-inspired layout, original color tone
   ========================================================= */
:root{
  --primary:#C8102E;
  --primary-dark:#A0001C;
  --primary-light:#FDEBEC;

  --success:#2E7D32;
  --success-light:#E8F5E9;

  --danger:#C8102E;
  --danger-light:#FDEBEC;

  --warning:#F9A825;

  --bg:#F7F7F7;
  --card-bg:#FFFFFF;

  --text:#222222;
  --muted:#666666;

  --border:#E5E5E5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Sarabun', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .brand, .btn, .logo-mark + span {
  font-family: 'Kanit', 'Sarabun', 'Segoe UI', sans-serif;
}

/* ---------------- Topbar ---------------- */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; flex: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.logo-mark svg { width: 20px; height: 20px; }

nav.mainnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
nav.mainnav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
nav.mainnav a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.nav-divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.user-tag {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 20px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-link { color: var(--danger); font-weight: 600; padding: 8px 12px; }
.nav-cta {
  background: var(--primary);
  color: #fff !important;
  padding: 9px 18px !important;
  border-radius: 20px;
}
.nav-cta:hover { background: var(--primary-dark) !important; }
.nav-outline {
  border: 1.5px solid var(--border);
  padding: 8px 16px !important;
  border-radius: 20px;
}
.nav-outline:hover { border-color: var(--primary); background: var(--primary-light) !important; }

/* ---------------- Page shell ---------------- */
.page { max-width: 1140px; margin: 0 auto; padding: 0 20px 60px; min-height: 60vh; }
.page-pad { padding-top: 24px; }

.footer-site {
  background: #101828;
  color: #cbd5e1;
  margin-top: 50px;
}
.footer-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 44px 20px 20px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    gap: 30px;
    align-items: center;
}
.footer-inner h4 { color: #fff; font-size: 1rem; margin: 0 0 12px; }
.footer-inner p, .footer-inner a { color: #94a3b8; font-size: 0.88rem; line-height: 1.8; }
.footer-inner a:hover { color: #fff; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-brand span { font-weight: 700; color: #fff; font-family: 'Kanit', sans-serif; font-size: 1.1rem; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  text-align: center; color: #64748b; font-size: 0.82rem;
  padding: 16px 20px;
}
.footer-logo{
    display:flex;
    justify-content:flex-end;
    align-items:center;
}

.footer-logo img{
    width:120px;
    height:auto;
}
.footer-logo img{
    width:120px !important;
    height:auto !important;
    max-width:120px !important;
    display:block;
}
.footer-logo{
    display:flex;
    justify-content:center;
    align-items:center;
}

.college-logo{
    width:120px;
    height:auto;
    max-width:120px;
}
.college-login-logo{
    width:180px;
    height:auto;
    margin:0 auto 25px;
    display:block;
}
.login-logo{
    text-align:center;
    margin-bottom:20px;
}

.login-logo img{
    width:120px;
    height:auto;
    display:inline-block;
}

@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } }

h1 { font-size: 1.7rem; margin-bottom: 6px; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
.subtitle { color: var(--muted); margin-top: 0; margin-bottom: 24px; }

/* ---------------- Alerts ---------------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.95rem; font-weight: 500; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.room-card { padding: 0; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.room-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.room-card .room-media { position: relative; }
.room-card img { width: 100%; height: 170px; object-fit: cover; background: #eef2f7; display: block; }
.room-card .room-body { padding: 16px 18px 18px; }
.room-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.room-meta { color: var(--muted); font-size: 0.88rem; margin: 3px 0; display: flex; align-items: center; gap: 6px; }
.room-card .room-status { position: absolute; top: 12px; right: 12px; }
.room-card .room-actions { margin-top: 14px; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
input[type=text], input[type=password], input[type=date], input[type=file],
input[type=number], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 16px;
  background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea { resize: vertical; min-height: 80px; }
.form-narrow { max-width: 420px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 24px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-block { width: 100%; text-align: center; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--card-bg); }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { background: #f9fafb; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table-wrap table { border: none; }

/* Badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.76rem; font-weight: 700; letter-spacing: .2px; }
.badge-pending { background: var(--warning-light); color: #92400e; }
.badge-approved { background: var(--success-light); color: #166534; }
.badge-rejected { background: var(--danger-light); color: #991b1b; }
.badge-available { background: var(--success-light); color: #166534; }
.badge-unavailable { background: #f3f4f6; color: #6b7280; }
.badge-solid { box-shadow: 0 2px 6px rgba(0,0,0,.12); }

/* Stat cards (admin dashboard) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: var(--primary); font-family: 'Kanit', sans-serif; }
.stat-card .label { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state .emoji { font-size: 2.4rem; display: block; margin-bottom: 10px; }

.profile-img {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border); background: #eef2f7;
}

/* details/summary "book this room" expander */
.room-card details { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.room-card summary {
  cursor: pointer; color: var(--primary); font-weight: 700; font-size: 0.9rem;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.room-card summary::-webkit-details-marker { display: none; }
.room-card summary::after { content: '▾'; transition: transform .15s; }
.room-card details[open] summary::after { transform: rotate(180deg); }

/* =========================================================
   Hero section (homepage) — Traveloka-style search banner
   ========================================================= */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  margin: 0 -20px;
  padding: 46px 20px 90px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 15% 25%, rgba(255,255,255,.10) 0, transparent 40%),
                     radial-gradient(circle at 85% 75%, rgba(255,255,255,.08) 0, transparent 45%);
  pointer-events: none;
}
.hero-inner { max-width: 1140px; margin: 0 auto; position: relative; }
.hero h1 { color: #fff; font-size: 2rem; max-width: 640px; }
.hero .subtitle { color: rgba(255,255,255,.85); font-size: 1.02rem; max-width: 560px; }

.search-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.search-card label { color: var(--text); font-size: 0.82rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.search-card input, .search-card select { margin-bottom: 0; }
.search-card .btn { padding: 12px 26px; white-space: nowrap; }
@media (max-width: 860px) {
  .search-card { grid-template-columns: 1fr 1fr; }
  .search-card .btn { grid-column: 1 / -1; }
}

.section-wrap { padding-top: 40px; }
.results-bar { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.results-bar .count { color: var(--muted); font-size: 0.9rem; }

/* =========================================================
   Auth split layout (login / register)
   ========================================================= */
.auth-shell {
  min-height: calc(100vh - 68px);
  display: flex;
  margin: 0 -20px -60px;
}
.auth-side {
  flex: 1 1 44%;
  background: linear-gradient(180deg, #c40000 0%, #8b0000 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
}
.auth-side h2{
    font-size:2rem;
    margin-bottom:8px;
    color:#fff;
}

.auth-side h3{
    color:#ffe9e9;
    font-weight:400;
    margin-bottom:20px;
}
.auth-side::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,.12) 0, transparent 35%),
                     radial-gradient(circle at 80% 80%, rgba(255,255,255,.10) 0, transparent 40%);
}
.auth-side-inner { position: relative; max-width: 380px; }
.auth-side h2 { color: #fff; font-size: 1.6rem; margin-bottom: 14px; }
.auth-side p { color: rgba(255,255,255,.82); line-height: 1.7; }
.auth-illustration { margin-bottom: 28px; }
.auth-illustration svg { width: 100%; max-width: 260px; height: auto; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: 0.92rem; color: rgba(255,255,255,.9); }
.auth-points li .dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; margin-top: 1px;
}

.auth-form-side { flex: 1 1 56%; display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--bg); }
.auth-wrap { max-width: 400px; width: 100%; margin: 0; box-shadow: none; border: none; background: transparent; padding: 0; }
.auth-wrap .card { box-shadow: var(--shadow-md); }
.auth-brand-mobile { display: none; }

@media (max-width: 900px) {
  .auth-shell { flex-direction: column; }
  .auth-side { padding: 40px 28px; }
  .auth-illustration svg { max-width: 160px; }
}
/* ==============================
   LINE Floating Contact
   ============================== */

a.line-contact {
    position: fixed !important;
    right: 25px !important;
    bottom: 25px !important;

    width: 76px !important;
    height: auto !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;

    gap: 6px !important;

    padding: 0 !important;
    margin: 0 !important;

    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;

    color: #222 !important;
    text-decoration: none !important;

    z-index: 99999 !important;
}

/* วงกลม LINE */
a.line-contact .line-contact-icon {
    width: 68px !important;
    height: 68px !important;

    min-width: 68px !important;
    min-height: 68px !important;

    max-width: 68px !important;
    max-height: 68px !important;

    aspect-ratio: 1 / 1 !important;

    border-radius: 50% !important;

    background: #06C755 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    color: white !important;

    font-family: Arial, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;

    box-shadow: 0 4px 12px rgba(0,0,0,.25) !important;

    padding: 0 !important;
    margin: 0 !important;

    border: none !important;

    overflow: hidden !important;

    box-sizing: border-box !important;
}

/* ==============================
   LINE Floating Contact
   ============================== */

a.line-contact {
    position: fixed !important;
    right: 25px !important;
    bottom: 25px !important;

    width: 80px !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;

    padding: 0 !important;
    margin: 0 !important;

    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;

    text-decoration: none !important;

    z-index: 99999 !important;
}

a.line-contact img {
    display: block !important;

    width: 68px !important;
    height: 68px !important;

    object-fit: contain !important;

    padding: 0 !important;
    margin: 0 0 5px 0 !important;

    border: none !important;
    border-radius: 0 !important;

    background: transparent !important;

    box-shadow: none !important;

    transition: transform .2s ease !important;
}

a.line-contact span {
    display: block !important;

    padding: 2px 10px !important;
    margin: 0 !important;

    background: #fff !important;

    color: #222 !important;

    border-radius: 10px !important;

    font-family: 'Kanit', 'Sarabun', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;

    line-height: 1.5 !important;

    white-space: nowrap !important;

    box-shadow: 0 2px 7px rgba(0,0,0,.15) !important;
}

a.line-contact:hover {
    background: transparent !important;
    text-decoration: none !important;
}


/* มือถือ */
@media (max-width: 600px) {
    a.line-contact {
        right: 16px !important;
        bottom: 16px !important;
        width: 70px !important;
    }

    a.line-contact img {
        width: 60px !important;
        height: 60px !important;
    }
}