/* Custom Application Styles */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

video {
    max-width: 100%;
    height: auto;
}

.logo-pc {
    display: none;
}

@media (min-width: 1024px) {
    .logo-mobile {
        display: none !important;
    }
    .logo-pc {
        display: block !important;
    }
}

:focus-visible {
    outline: 2px solid #66aaff;
    outline-offset: 2px;
}

.favorite-toggle.is-favorited i {
    color: var(--color-destructive, #ef4444);
}

/* Banner Carousel Styles (.hbc) */
.hbc { position: relative; width: 100%; }
.hbc__viewport { overflow: hidden; border-radius: 12px; border: 1px solid rgba(0,0,0,.08); background: #f3f4f6; }
.hbc__track { display: flex; transition: transform .7s ease-in-out; will-change: transform; }
.hbc__slide { flex: 0 0 100%; max-width: 100%; }
.hbc__slide a { display: block; width: 100%; height: 300px; }
.hbc__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hbc__btn {
    position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center; border-radius: 9999px;
    background: rgba(255,255,255,.85); color: #111; border: 1px solid rgba(0,0,0,.1);
    box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: pointer; opacity: 0; transition: opacity .25s; z-index: 2;
}
.hbc:hover .hbc__btn { opacity: 1; }
.hbc__btn--prev { left: 12px; }
.hbc__btn--next { right: 12px; }
.hbc__dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; z-index: 2; }
.hbc__dot { width: 8px; height: 8px; border-radius: 9999px; border: 0; padding: 0; cursor: pointer; background: rgba(255,255,255,.65); transition: all .3s; }
.hbc__dot.is-active { width: 20px; background: var(--color-primary, #3b82f6); }
@media (max-width: 1024px) { .hbc__slide a { height: 200px; } }

/* Mobile Bottom Navbar (.mbn) */
.mbn-spacer { display: block; height: 64px; }
.mbn { display: none; }
.mbn__inner { display: grid; grid-template-columns: repeat(5, 1fr); height: 60px; }
.mbn__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--kt-text-muted, #6b7280); text-decoration: none; transition: color .2s;
    font-size: 10px; font-weight: 500;
}
.mbn__item i { font-size: 20px; line-height: 1; }
.mbn__item.is-active, .mbn__item:hover { color: var(--color-primary, #3b82f6); }
.mbn__fab {
    margin-top: -24px; display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 9999px; background: var(--color-primary, #3b82f6);
    color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); border: 4px solid var(--kt-card-bg, #7daaf4ff);
}
[data-kt-theme-mode="dark"] .mbn { border-top-color: var(--kt-border-color, rgba(255, 255, 255, 0.06)); }
[data-kt-theme-mode="dark"] .mbn__item { color: var(--kt-text-muted, #9ca3af); }
[data-kt-theme-mode="dark"] .mbn__item.is-active, [data-kt-theme-mode="dark"] .mbn__item:hover { color: var(--color-primary, #3b82f6); }
@media (max-width: 1023px) {
    .mbn {
        display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
        backdrop-filter: blur(10px); border-top: 1px solid var(--kt-border-color, rgba(0, 0, 0, .08));
        padding-bottom: env(safe-area-inset-bottom);
    }
}
@media (min-width: 1024px) { .mbn-spacer { display: none; } }

/* Toast & Confirm Overlay */
#tb-toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 100000; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.tb-toast {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; line-height: 1.4; opacity: 0; transform: translateX(20px);
    transition: opacity .3s, transform .3s; background: #334155;
}
.tb-toast.show { opacity: 1; transform: translateX(0); }
.tb-toast--success { background: #16a34a; }
.tb-toast--error { background: #dc2626; }
.tb-toast--warning { background: #d97706; }
.tb-toast--info { background: #2563eb; }
.tb-toast i { font-size: 18px; line-height: 1; }

#tb-confirm-overlay {
    position: fixed; inset: 0; z-index: 100001; display: none; align-items: center; justify-content: center;
    background: rgba(15,23,42,.55); backdrop-filter: blur(2px); padding: 16px;
}
#tb-confirm-overlay.show { display: flex; }
.tb-confirm {
    width: 100%; max-width: 400px; background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: tbPop .2s ease;
}
@keyframes tbPop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tb-confirm__body { padding: 24px 22px 8px; text-align: center; }
.tb-confirm__icon {
    width: 56px; height: 56px; border-radius: 9999px; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px; font-size: 28px; background: #fef3c7; color: #d97706;
}
.tb-confirm__title { font-size: 17px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.tb-confirm__msg { font-size: 14px; color: #475569; }
.tb-confirm__actions { display: flex; gap: 10px; padding: 18px 22px 22px; }
.tb-confirm__btn { flex: 1; border: 0; border-radius: 9px; padding: 11px 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.tb-confirm__btn--cancel { background: #e2e8f0; color: #334155; }
.tb-confirm__btn--ok { background: #dc2626; color: #fff; }
[data-kt-theme-mode="dark"] .tb-confirm__title { color: #fff; }
[data-kt-theme-mode="dark"] .tb-confirm__msg { color: #cbd5e1; }
[data-kt-theme-mode="dark"] .tb-confirm__btn--cancel { background: #2b2b40; color: #e2e8f0; }

/* QR Scanner Animation */
.qr-scan-blue { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.qr-scan-blue:before { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: linear-gradient(180deg, transparent, rgba(0,183,255,.45), transparent); animation: qrScan 3s infinite; }
@keyframes qrScan { 0% { top: -50%; } 50% { top: 100%; } 100% { top: -50%; } }

/* Pagination & Clamp Custom Styles */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
/* Chat Widget Custom Styles */
.chat-widget {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-widget.active { opacity: 1; transform: translateY(0) scale(1); }
.chat-widget .chat-toggle {
    display: flex; align-items: center; gap: 10px; padding: 10px 20px 10px 14px;
    border-radius: 50px; background: linear-gradient(135deg, #009ef7, #00b4ff);
    box-shadow: 0 8px 32px rgba(0, 158, 247, 0.35); cursor: pointer; border: 1px solid rgba(255,255,255,0.15);
    color: #fff; font-weight: 600; font-size: 14px; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative; user-select: none; backdrop-filter: blur(4px);
}
.chat-widget .chat-toggle:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 12px 40px rgba(0, 158, 247, 0.45); }
.chat-widget .chat-toggle:active { transform: scale(0.96); }
.chat-widget .chat-toggle .toggle-icon {
    width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    transition: all 0.3s ease; flex-shrink: 0;
}
.chat-widget .chat-toggle:hover .toggle-icon { transform: rotate(-8deg) scale(1.05); background: rgba(255,255,255,0.3); }
.chat-widget .chat-toggle .toggle-text { white-space: nowrap; letter-spacing: 0.3px; }
.chat-widget .chat-toggle .badge-dot {
    width: 10px; height: 10px; background: #f64e60; border-radius: 50%;
    position: absolute; top: 4px; right: 4px; border: 2px solid #009ef7;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.7; } }
.chat-widget .chat-toggle .pulsation {
    position: absolute; inset: -4px; border-radius: 50px; border: 2px solid rgba(0, 158, 247, 0.2);
    animation: pulse-ring 2.5s ease-out infinite; pointer-events: none;
}
.chat-widget .chat-toggle .pulsation:nth-child(2) { animation-delay: 0.8s; }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.15); opacity: 0; } }
.chat-widget .chat-prompt {
    position: absolute; bottom: calc(100% + 12px); right: 0; background: #fff;
    border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.12); padding: 14px 20px;
    transform: scale(0.85) translateY(10px); transform-origin: bottom right;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); border: 1px solid rgba(0,0,0,0.06);
    opacity: 0; pointer-events: none; font-size: 13px; color: #1e293b; max-width: 260px; min-width: 180px; z-index: 10;
}
.chat-widget .chat-prompt.open { transform: scale(1) translateY(0); opacity: 1 !important; pointer-events: auto; }
.chat-widget .chat-prompt:before {
    content: ''; position: absolute; bottom: -8px; right: 28px;
    border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.02));
}
.chat-widget .chat-prompt .prompt-close {
    position: absolute; top: 4px; right: 4px; cursor: pointer; color: #94a3b8; background: none;
    border: none; padding: 4px; border-radius: 6px; transition: all 0.2s ease; line-height: 1; font-size: 14px; z-index: 11;
}
.chat-widget .chat-prompt .prompt-close:hover { color: #1e293b; background: #f1f5f9; }
.chat-widget .chat-prompt .prompt-content { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.chat-widget .chat-prompt .prompt-content .prompt-icon { color: #009ef7; font-size: 18px; flex-shrink: 0; }
.chat-widget .chat-prompt .prompt-content .prompt-text { font-weight: 500; color: #1e293b; }
.chat-widget .chat-prompt .prompt-content .typing-indicator { display: inline-flex !important; gap: 4px; align-items: center; padding: 2px 0; }
.chat-widget .chat-prompt .prompt-content .typing-indicator span {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8;
    animation: typing-bounce 1.4s ease-in-out infinite both;
}
.chat-widget .chat-prompt .prompt-content .typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.chat-widget .chat-prompt .prompt-content .typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.chat-widget .chat-prompt .prompt-content .typing-indicator span:nth-child(3) { animation-delay: 0s; }
@keyframes typing-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
.chat-widget .chat-dropdown {
    position: absolute; bottom: calc(100% + 12px); right: 0; width: 310px; max-height: 460px;
    background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.04);
    padding: 0; transform: scale(0.85) translateY(10px); transform-origin: bottom right;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); opacity: 0; pointer-events: none;
    border: 1px solid rgba(0,0,0,0.04); overflow-y: auto; scroll-behavior: smooth; z-index: 5;
}
.chat-widget .chat-dropdown.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }
.chat-widget .chat-dropdown:before {
    content: ''; position: absolute; bottom: -8px; right: 28px;
    border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.02));
}
.chat-widget .chat-dropdown .dropdown-header {
    padding: 14px 20px 10px; border-bottom: 1px solid #f1f5f9; position: sticky; top: 0;
    background: #fff; z-index: 1; border-radius: 16px 16px 0 0;
}
.chat-widget .chat-dropdown .dropdown-header .header-title { font-size: 14px; font-weight: 700; color: #1e293b; margin: 0; display: flex; align-items: center; gap: 8px; }
.chat-widget .chat-dropdown .dropdown-header .header-title i { color: #009ef7; }
.chat-widget .chat-dropdown .dropdown-header .header-sub { font-size: 12px; color: #94a3b8; margin: 2px 0 0 0; }
.chat-widget .chat-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 20px;
    text-decoration: none; color: #1e293b; cursor: pointer; border: none; background: none;
    width: 100%; text-align: left; transition: all 0.2s ease; border-left: 3px solid transparent;
}
.chat-widget .chat-item:hover { background: #f8fafc; border-left-color: #009ef7; }
.chat-widget .chat-item:active { transform: scale(0.98); background: #f1f5f9; }
.chat-widget .chat-item .chat-icon {
    width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #fff; font-size: 16px; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden; background: #f1f5f9;
}
.chat-widget .chat-item:hover .chat-icon { transform: scale(1.08) rotate(-4deg); }
.chat-widget .chat-item .chat-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-widget .chat-item .chat-icon .icon-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, #009ef7, #00b4ff);
}
.chat-widget .chat-item .chat-info { flex: 1; min-width: 0; }
.chat-widget .chat-item .chat-info .chat-title { font-size: 13px; font-weight: 600; color: #1e293b; margin: 0; line-height: 1.3; }
.chat-widget .chat-item .chat-info .chat-subtitle { font-size: 11px; color: #94a3b8; margin: 0; font-weight: 400; }
.chat-widget .chat-item .item-badge {
    background: #009ef7; color: #fff; font-size: 9px; font-weight: 700; padding: 2px 10px;
    border-radius: 10px; text-transform: uppercase; letter-spacing: 0.3px; flex-shrink: 0;
}
.chat-widget .chat-item .item-arrow { color: #cbd5e1; font-size: 12px; transition: all 0.2s ease; flex-shrink: 0; }
.chat-widget .chat-item:hover .item-arrow { color: #009ef7; transform: translateX(3px); }
@media (max-width: 767px) {
    .chat-widget { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); right: 16px; }
    .chat-widget .chat-toggle { padding: 8px 16px 8px 12px; font-size: 13px; gap: 8px; }
    .chat-widget .chat-toggle .toggle-icon { width: 28px; height: 28px; font-size: 14px; }
    .chat-widget .chat-dropdown { width: 280px; max-height: 380px; right: -8px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .chat-widget { 
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        right: 24px; 
    }
}