/* Tailwind Config - Import */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@300;400;500;700;900&display=swap');

/* ========================================
Tailwind Configuration
======================================== */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* ========================================
Base Styles & Layout
======================================== */
html, body {
height: 100%;
margin: 0;
padding: 0;
}

body {
font-family: 'Noto Sans Lao', sans-serif;
background-color: #0A0A0A;
color: #E5E7EB;
display: flex;
justify-content: center;
}

#appPage {
max-width: 768px;
width: 100%;
background-color: #0A0A0A;
min-height: 100vh;
position: relative;
padding-bottom: 96px;
}

/* ========================================
Custom Scrollbar
======================================== */
::-webkit-scrollbar {
width: 6px;
}

::-webkit-scrollbar-track {
background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
background: #333;
border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
background: #FE2C55;
}

/* ========================================
Glass Input Effect
======================================== */
.glass-input {
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
transition: all 0.3s ease;
}

.glass-input:focus {
background: rgba(255, 255, 255, 0.1);
border-color: #FE2C55;
box-shadow: 0 0 15px rgba(254, 44, 85, 0.3);
}

/* ========================================
Loader Animation
======================================== */
.loader {
border: 3px solid rgba(255,255,255,0.3);
border-radius: 50%;
border-top: 3px solid white;
width: 20px;
height: 20px;
animation: spin 1s linear infinite;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

/* ========================================
Modal Animations
======================================== */
.modal {
transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-content {
transition: transform 0.3s ease, opacity 0.3s ease;
}

.hidden.modal {
opacity: 0;
visibility: hidden;
}

.hidden.modal .modal-content {
transform: translateY(20px) scale(0.95);
opacity: 0;
}

.modal.show {
opacity: 1;
visibility: visible;
}

.modal.show .modal-content {
transform: translateY(0) scale(1);
opacity: 1;
}

/* ========================================
Form Animations
======================================== */
@keyframes fade-in-up {
from {
    opacity: 0;
    transform: translateY(30px);
}
to {
    opacity: 1;
    transform: translateY(0);
}
}

.animate-fade-in-up {
animation: fade-in-up 0.6s ease-out;
}

/* ========================================
Glass Input Effects
======================================== */
.glass-input {
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}

.glass-input:focus {
background: rgba(255, 255, 255, 0.12);
border-color: rgba(255, 119, 198, 0.3);
box-shadow: 0 8px 32px rgba(255, 119, 198, 0.1);
}

/* ========================================
Safe Area Support (iOS)
======================================== */
.safe-area-bottom {
padding-bottom: env(safe-area-inset-bottom);
}

.h-safe-area-bottom {
height: env(safe-area-inset-bottom);
}

/* ========================================
Header Animations
======================================== */
@keyframes slide-down {
from {
    opacity: 0;
    transform: translateY(-100%) scale(0.95);
}
to {
    opacity: 1;
    transform: translateY(0) scale(1);
}
}

.animate-slide-down {
animation: slide-down 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gradient-x {
0%, 100% {
    background-size: 200% 200%;
    background-position: left center;
}
50% {
    background-size: 200% 200%;
    background-position: right center;
}
}

.animate-gradient-x {
background-size: 200% 200%;
animation: gradient-x 3s ease infinite;
}

/* ========================================
Floating Action Button
======================================== */
@keyframes fab-bounce-in {
0% {
    opacity: 0;
    transform: translateY(120%) scale(0.3) rotate(-10deg);
}
40% {
    opacity: 0.8;
    transform: translateY(-20%) scale(1.1) rotate(5deg);
}
70% {
    opacity: 1;
    transform: translateY(5%) scale(0.95) rotate(-2deg);
}
100% {
    opacity: 1;
    transform: translateY(0%) scale(1) rotate(0deg);
}
}

@keyframes fab-pulse {
0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
}
50% {
    box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
}
}

.fab-enter {
animation: fab-bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
pointer-events: auto !important;
}

.fab-pulse {
animation: fab-pulse 2s infinite;
}

@keyframes pulse-fade {
0%, 100% {
    opacity: 1;
}
50% {
    opacity: 0.7;
}
}

.animate-pulse-fade {
animation: pulse-fade 2s ease-in-out infinite;
}

/* ========================================
Checkout / Step 2 Styles
======================================== */
.checkout-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.015));
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.checkout-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
    border-color: rgba(255,119,198,0.06);
}
.checkout-item .left {
    display: flex;
    gap: 12px;
    align-items: center;
}
.checkout-item .title {
    font-weight: 800;
    color: #ffffff;
}
.checkout-item .meta {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}
.checkout-item .price {
    font-weight: 900;
    color: #ff2d5b;
}

.summary-card {
    padding: 1rem;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.035);
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.sticky-checkout {
    position: sticky;
    top: 1.25rem;
}

/* Submit button prominence */
#submitBtn {
    --btn-shadow: 0 14px 40px rgba(254,44,85,0.18);
    box-shadow: var(--btn-shadow);
    transform-origin: center;
}
#submitBtn:active {
    transform: translateY(1px) scale(0.995);
}

/* Mobile sticky full-width action */
@media (max-width: 640px) {
    #submitBtn {
        width: 100%;
        border-radius: 12px;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Step2 item animations and input validation */
.link-input.valid { outline: 2px solid rgba(34,197,94,0.18); box-shadow: 0 6px 20px rgba(34,197,94,0.06); }
.link-input.invalid { outline: 2px solid rgba(239,68,68,0.12); box-shadow: 0 6px 20px rgba(239,68,68,0.04); }

.animate-slide-in {
    animation: slide-in-right 400ms cubic-bezier(.22,.9,.35,1);
}
@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-pop-in {
    animation: pop-in 260ms cubic-bezier(.2,.9,.3,1);
}
@keyframes pop-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Submit button ready state */
.btn-ready {
    transform: translateY(-2px);
    box-shadow: 0 18px 50px rgba(254,44,85,0.25);
    animation: ready-breath 2.4s infinite;
}
@keyframes ready-breath {
    0% { transform: translateY(-2px) scale(1); }
    50% { transform: translateY(-4px) scale(1.01); }
    100% { transform: translateY(-2px) scale(1); }
}

/* ========================================
Modern Navigation Bar
======================================== */
.tab-bar-nav {
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}

/* Navigation tab animations */
.nav-tab {
position: relative;
overflow: hidden;
}

.nav-tab::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
border-radius: inherit;
opacity: 0;
transition: opacity 0.3s ease;
}

.nav-tab:hover::before {
opacity: 1;
}

/* Active tab glow effect */
.nav-tab.active {
box-shadow: 0 0 20px rgba(255, 59, 48, 0.3);
}

/* ========================================
Header / Nav Smoothing Fixes
Reduce harsh separator lines and soften edges to avoid visible black cut
======================================== */
header {
    /* lower-contrast border and subtle shadow for smooth separation */
    border-bottom: 1px solid rgba(255,255,255,0.03) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
    background: linear-gradient(180deg, rgba(10,10,10,0.96), rgba(10,10,10,0.92));
}

.tab-bar-nav,
nav.fixed {
    border-top: 1px solid rgba(255,255,255,0.03) !important;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
    background: linear-gradient(180deg, rgba(10,10,10,0.95), rgba(10,10,10,0.92));
}

/* If any legacy fixed-bottom-bar exists, hide it to avoid overlapping edges */
.fixed-bottom-bar {
    display: none !important;
}

/* Improve card borders so they blend with background rather than produce hard lines */
.bg-cardDark,
.modal-content,
.package-card,
.group {
    border-color: rgba(255,255,255,0.04) !important;
}

/* Header overlay z-index fix: ensure decorative overlay doesn't block header content */
header > .absolute {
    z-index: 0;
    pointer-events: none;
}
header > .relative {
    z-index: 10;
}

/* Ensure header user and auth button are always visible above decorative overlays */
#currentUserDisplay, #authActionButton {
    position: relative;
    z-index: 99999 !important;
    display: inline-flex;
    align-items: center;
}

#authActionButton {
    background-clip: padding-box;
}

/* Flash animation when item is added to cart to make it more visible */
.flash-added {
    animation: flash-added 900ms ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 0 0 4px rgba(99,102,241,0.08);
    transform: translateY(-4px);
}

@keyframes flash-added {
    0% { background-color: rgba(16,185,129,0.06); transform: translateY(0); }
    40% { background-color: rgba(16,185,129,0.12); transform: translateY(-6px); }
    100% { background-color: transparent; transform: translateY(0); }
}


/* ========================================
Fixed Bottom Action Bar
======================================== */
.fixed-bottom-bar {
position: fixed;
bottom: 64px;
left: 0;
right: 0;
z-index: 45;
padding: 10px 20px;
background-color: #0A0A0A;
box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.5);
transition: all 0.3s ease-out;
border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 768px) {
.fixed-bottom-bar {
left: 50%;
transform: translateX(-50%);
width: 768px;
max-width: 768px;
}
}

/* ========================================
Tab Bar Navigation
======================================== */
.tab-bar-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
max-width: 768px;
margin: 0 auto;
transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-bar-nav.hidden {
opacity: 0;
transform: translateY(100%);
pointer-events: none;
}

/* ========================================
How-To Modal Specific Styling
======================================== */
.howto-modal .modal-content {
max-width: 820px;
width: 100%;
border-radius: 16px;
overflow: hidden;
}

.howto-modal .modal-content {
transform: translateY(10px) scale(.98);
opacity: 0;
transition: transform 260ms cubic-bezier(.2,.9,.2,1), opacity 260ms ease-out;
}

.howto-modal.show .modal-content {
transform: translateY(0) scale(1);
opacity: 1;
}

.howto-modal .howto-image {
width: 100%;
height: auto;
border-radius: 8px;
max-height: 66vh;
object-fit: contain;
background: linear-gradient(180deg,#070707,#0f0f0f);
display:block;
opacity:0;
transform: translateY(6px);
transition: opacity 260ms ease, transform 260ms cubic-bezier(.2,.9,.2,1);
}

.howto-image.visible {
opacity: 1;
transform: translateY(0);
}

.howto-header {
display:flex;
align-items:center;
gap:12px;
}

.howto-title {
font-weight:800;
font-size:1.15rem;
}

.howto-footer {
display:flex;
justify-content:space-between;
align-items:center;
gap:12px;
margin-top:10px;
}

/* ========================================
Custom Animations (Tailwind)
======================================== */
@keyframes fadeInUp {
0% { opacity: 0; transform: translateY(20px); }
100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
0% { opacity: 0; transform: translateY(-10px); height: 0; }
100% { opacity: 1; transform: translateY(0); height: auto; }
}

@keyframes slideUp {
0% { opacity: 1; transform: translateY(0); height: auto; }
100% { opacity: 0; transform: translateY(-10px); height: 0; }
}

@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-5px); }
75% { transform: translateX(5px); }
}

@keyframes pulseFade {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.8; transform: scale(1.02); }
}

.animate-fade-in-up {
animation: fadeInUp 0.5s ease-out;
}

.animate-slide-down {
animation: slideDown 0.4s ease-out;
}

.animate-slide-up {
animation: slideUp 0.4s ease-out;
}

.animate-shake {
animation: shake 0.4s ease-in-out;
}

.animate-pop-in {
animation: fadeInUp 0.3s ease-out;
}

.animate-pulse-fade {
animation: pulseFade 2s infinite;
}

/* ========================================
Tailwind Custom Colors (for reference)
======================================== */
:root {
–color-tiktok: #FE2C55;
–color-tiktok-dark: #E0113A;
–color-bg-dark: #0A0A0A;
–color-card-dark: #141414;
–color-input-dark: #1F1F1F;
}

/* ========================================
Contact Icon Styling
======================================== */
.contact-icon img {
filter: brightness(1.1);
}

/* ========================================
Additional UI Elements
======================================== */
.bg-tiktok { background-color: #FE2C55 !important; }
.bg-tiktokDark { background-color: #E0113A !important; }
.bg-bgDark { background-color: #0A0A0A !important; }
.bg-cardDark { background-color: #141414 !important; }
.bg-inputDark { background-color: #1F1F1F !important; }

.text-tiktok { color: #FE2C55 !important; }
.text-tiktokDark { color: #E0113A !important; }

.border-tiktok { border-color: #FE2C55 !important; }

/* Shadow for TikTok color */
.shadow-tiktok {
–tw-shadow-color: rgba(254, 44, 85, 0.3);
–tw-shadow: var(–tw-shadow-colored);
}

/* ========================================
Responsive Adjustments
======================================== */
@media (max-width: 640px) {
#appPage {
padding-bottom: 80px;
}
}

/* ========================================
Category Tab Active State
======================================== */
.category-tab.active,
.category-tab[data-active="true"] {
background-color: #FE2C55;
color: white;
box-shadow: 0 10px 15px -3px rgba(254, 44, 85, 0.3);
}

/* ========================================
Print Styles
======================================== */
@media print {
.tab-bar-nav,
.fixed-bottom-bar,
header {
display: none !important;
}
}