/* หน้าแรกสูงกว่าจอ (การ์ดโควตา + ลิงก์ล่าง) : เดิม body สูงเท่าจอพอดี (html.h-full) => เลื่อนลงแล้วพื้นขาว
   => ให้ body ยืดตามเนื้อหา + สีพื้นเข้มต่อจากรูป (รวมตอนดึงหน้าเด้งบน iOS) */
html:has(body#home-page) {
    background-color: #000;
}
body#home-page.bg-img {
    height: auto;
    min-height: 100%;
    background-color: #000;
}
/* หน้าแรกไม่มีแถบหัว : เลื่อนลงแล้ว app.js ใส่ bg-show => แถบสีโผล่ด้านบน (inc.header.php ไม่รับ "bg" => false) => ซ่อนเฉพาะหน้านี้ */
#home-page #app-header-section .header-container:before {
    display: none;
}


/* โลโก้ + เมนู เป็นกลุ่มเดียว อยู่กลางจอแนวตั้ง (มือถือสูงไม่เท่ากัน) — เนื้อหาสูงกว่าจอ => เลื่อนตามปกติ
   โลโก้ย่อตามความสูงจอ (vh) เครื่องเตี้ยไม่ต้องเลื่อน */
#home-page #app-main-section {
    min-height: auto !important;
}
#home-page .main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

#home-page .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    padding: 0 0 4vh;
}
#home-page .logo>.this-logo {
    position: relative;
    width: min(250px, 28vh);
    height: min(250px, 28vh);
    background-image: url(../../images/logo.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}
#home-page .company {
    position: relative;
    font-size: 10px;
    line-height: 20px;
    font-weight: 400;
    margin-top: auto;
    padding: 20px 0;
}

#home-page .menu-shortcut-section {
    position: relative;
    width: 100%;
}
/* จอเตี้ย (เช่น iPhone SE 568px) : ย่อการ์ดเมนู / หัวข้อ ให้ทั้งกลุ่มพอดีจอ */
@media (max-height: 699.98px) {
    #home-page .main-container { padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    #home-page .logo { padding-bottom: 2.5vh; }
    #home-page .menu-shortcut-section .menu-shortcut-title { margin-bottom: 10px; font-size: 18px; line-height: 26px; }
    #home-page .menu-shortcut-section .menu-shortcut-card { height: 64px; }
    #home-page .menu-shortcut-section .menu-shortcut-card>.menu-shortcut-card-inner { padding: 12px 22px; }
    #home-page .menu-shortcut-section ul.menu-shortcut-group>li.menu-shortcut-item+li.menu-shortcut-item { margin-top: 8px; }
    #home-page .menu-shortcut-section .mg-top-20 { margin-top: 12px !important; }
}
#home-page .menu-shortcut-section .menu-shortcut-title {
    position: relative;
    text-align: center;
    margin-bottom: 15px;
}
#home-page .menu-shortcut-section ul.menu-shortcut-group,
#home-page .menu-shortcut-section ul.menu-shortcut-group>li.menu-shortcut-item {
    position: relative;
    list-style: none !important;
    margin: 0;
    padding: 0;
    width: 100%;
}
#home-page .menu-shortcut-section ul.menu-shortcut-group>li.menu-shortcut-item+li.menu-shortcut-item {
    margin-top: 10px;
}
#home-page .menu-shortcut-section .menu-shortcut-card {
    position: relative;
    width: 100%;
    height: 80px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    /* box-shadow: 0 0 0 2px rgba(255,255,255,0.2); */
}
#home-page .menu-shortcut-section .menu-shortcut-card:before,
#home-page .menu-shortcut-section .menu-shortcut-card:after {
    position: absolute;
    content: "";
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    -webkit-backdrop-filter: saturate(100%) blur(10px);
    -moz-backdrop-filter: saturate(100%) blur(10px);
    -ms-backdrop-filter: saturate(100%) blur(10px);
    -o-backdrop-filter: saturate(100%) blur(10px);
    backdrop-filter: saturate(100%) blur(10px);
}
#home-page .menu-shortcut-section .menu-shortcut-card:before {
    background: linear-gradient(to right, rgba(var(--rw-rgb-color-3), 0.3), rgba(var(--rw-rgb-color-3), 0.6));
    z-index: 1;
}
#home-page .menu-shortcut-section .menu-shortcut-card:after {
    background: linear-gradient(to right, rgba(var(--rw-rgb-color-1), 1), rgba(var(--rw-rgb-color-3), 1));
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-transition: opacity 0.3s ease;
    -moz-transition: opacity 0.3s ease;
    -ms-transition: opacity 0.3s ease;
    -o-transition: opacity 0.3s ease;
    z-index: 2;
}
#home-page .menu-shortcut-section .menu-shortcut-card:hover:after {
    opacity: 1;
}
#home-page .menu-shortcut-section .menu-shortcut-card>.menu-shortcut-card-inner {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 20px 30px;
    z-index: 3;
}
#home-page .menu-shortcut-section .menu-shortcut-card>.menu-shortcut-card-inner>.icon {
    font-size: 40px;
    line-height: 35px;
    width: 40px;
    text-align: center;
}
#home-page .menu-shortcut-section .menu-shortcut-card>.menu-shortcut-card-inner>.title {
    flex: 1 0 0;
    width: calc(100% - 50px);
    padding: 0 15px;
    font-size: 18px;
    line-height: 20px;
}
#home-page .menu-shortcut-section .menu-shortcut-card>.menu-shortcut-card-inner>.icon-arrow {
    font-size: 10px;
    width: 10px;
    text-align: center;
}

#home-page .menu-shortcut-section .menu-shortcut-card.menu-upload #select-file-img {
    position: absolute;
    opacity: 0;
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    overflow: hidden;
    cursor: pointer;
    z-index: 10;
}


#login-popup {}
#login-popup .modal-content {
    background: none !important;
    border-radius: 0 !important;
}
#login-popup .modal-body {
    padding: 0 !important;
}

/* --------------------------------------------------------------- */
/* ------------------------- โควตาคงเหลือ ------------------------- */
/* --------------------------------------------------------------- */

#home-page .quota-card {
    position: relative;
    margin: 0 0 14px 0;
    padding: 10px 14px;
    border-radius: 16px;
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: rgba(var(--rw-rgb-color-white),1);
    text-align: left;
}
#home-page .quota-card.is-empty {
    border-color: rgba(255,120,120,0.55);
}
#home-page .quota-card .quota-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
#home-page .quota-card .quota-badge {
    flex: none;
    padding: 1px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
}
#home-page .quota-card .quota-badge.is-free {
    background-color: rgba(255,255,255,0.2);
}
#home-page .quota-card .quota-badge.is-plan {
    background-color: rgba(255,218,0,1);
    color: rgba(0,0,0,0.85);
}
#home-page .quota-card .quota-today {
    font-size: 14px;
    line-height: 22px;
    white-space: nowrap;
}
#home-page .quota-card .quota-today strong {
    font-size: 18px;
    font-weight: 600;
    margin: 0 2px;
}
#home-page .quota-card.is-empty .quota-today strong {
    color: rgba(255,140,140,1);
}
#home-page .quota-card .quota-expire {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
}
/* บรรทัดที่ 2 : รายละเอียด (ซ้าย) + ปุ่มซื้อ (ขวา) */
#home-page .quota-card .quota-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
#home-page .quota-card .quota-detail-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    line-height: 17px;
    opacity: 0.75;
}
/* จอเล็ก (320px) : บรรทัดแรกล้นการ์ด (วันหมดอายุ) => ย่อ / ลดระยะ */
@media (max-width: 359.98px) {
    #home-page .quota-card { padding: 9px 11px; }
    #home-page .quota-card .quota-row { gap: 6px; }
    #home-page .quota-card .quota-badge { padding: 1px 7px; font-size: 11px; }
    #home-page .quota-card .quota-today { font-size: 13px; }
    #home-page .quota-card .quota-today strong { font-size: 16px; }
    #home-page .quota-card .quota-expire { font-size: 11px; }
    #home-page .quota-card .quota-detail-text { font-size: 11px; line-height: 15px; }
    #home-page .quota-card .quota-buy { padding: 2px 10px; font-size: 11px; }
}
/* แต่ละรายการไม่ตัดกลาง (เช่น "รอบนี้เหลือ 496/500" ยกไปบรรทัดใหม่ทั้งก้อน) */
#home-page .quota-card .quota-item {
    white-space: nowrap;
}
#home-page .quota-card .quota-deny {
    color: rgba(255,170,170,1);
    opacity: 1;
}
#home-page .quota-card .quota-buy {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 12px;
    white-space: nowrap;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    color: rgba(0,0,0,0.85);
    background-color: rgba(255,218,0,1);
    text-decoration: none;
}
#home-page .quota-card .quota-buy .bi {
    font-size: 10px;
}
