@import "./assets/css/main.css";

/* style.css - Giao diện Dark Mode MMO */

/* --- Biến màu sắc và Font chữ --- */
:root {
    --bg-color: #0f172a; /* Nền xanh đen đậm */
    --surface-color: rgba(30, 41, 59, 0.6); /* Màu nền card Glassmorphism */
    --border-color: rgba(51, 65, 85, 0.5);
    --primary-text-color: #e2e8f0; /* Màu chữ chính (trắng xám) */
    --secondary-text-color: #94a3b8; /* Màu chữ phụ */
    --accent-color: #34d399; /* Xanh lá cây neon */
    --accent-hover-color: #6ee7b7;
    --glow-color: rgba(52, 211, 153, 0.5);
}

/* --- Thiết lập chung cho toàn trang --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 20px 20px;
}

/* --- Header --- */
.header {
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

/* Make header sticky and add a scrolled/shrink state */
.header {
    position: sticky;
    top: 0;
    z-index: 60;
    transition: padding 200ms ease, box-shadow 200ms ease, backdrop-filter 200ms ease;
}
.header--scrolled {
    padding-top: 0.45rem; /* slightly smaller */
    padding-bottom: 0.45rem;
    box-shadow: 0 6px 18px rgba(2,6,23,0.6);
}

/* When header is fixed we add top padding equal to header height so page content isn't hidden */
body.header-fixed {
    padding-top: var(--header-height, 72px);
}

/* --- Language Switcher --- */
/* Language Switcher - Alpine.js Enhanced */
.lang-switcher {
    position: relative;
}

/* Alpine.js language menu styles */
#language-menu {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#language-menu:hover {
    background-color: rgba(51, 65, 85, 0.5);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

#language-menu:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

#language-menu svg {
    transition: transform 0.2s ease;
}

/* Dropdown menu container */
[x-show][role="menu"] {
    position: absolute;
    right: 0;
    margin-top: 0.5rem;
    min-width: 160px;
    background-color: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.375rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    z-index: 50;
}

/* Dropdown items */
[x-show][role="menu"] a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--primary-text-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

[x-show][role="menu"] a:last-child {
    border-bottom: none;
}

[x-show][role="menu"] a:hover:not([aria-current]) {
    background-color: rgba(51, 65, 85, 0.4);
    color: var(--accent-color);
    padding-left: 1.25rem;
}

[x-show][role="menu"] a[aria-current="page"] {
    background-color: rgba(52, 211, 153, 0.15);
    color: var(--accent-color);
    font-weight: 600;
}

/* Legacy CSS for non-Alpine components (if any) */
.lang-switcher-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.lang-switcher-button:hover {
    background-color: rgba(51, 65, 85, 0.8);
    border-color: var(--accent-color);
}
.lang-switcher-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background-color: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}
.lang-switcher-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.lang-switcher-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--primary-text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}
.lang-switcher-item:last-child {
    border-bottom: none;
}
.lang-switcher-item:hover {
    background-color: rgba(51, 65, 85, 0.5);
    color: var(--accent-color);
}
.lang-switcher-item.active {
    background-color: rgba(52, 211, 153, 0.1);
    color: var(--accent-color);
}
.lang-switcher-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.lang-switcher-item.disabled:hover {
    background-color: transparent;
    color: var(--secondary-text-color);
}
.lang-flag {
    font-size: 1.5rem;
    line-height: 1;
}
.lang-name {
    flex: 1;
    font-weight: 500;
}
.lang-status {
    font-size: 0.75rem;
    color: var(--secondary-text-color);
}

/* --- Hero Section Gradient Text --- */
.text-gradient {
    background: linear-gradient(90deg, #ffffff, #a7f3d0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

}


/* --- Card Styles (Glassmorphism) --- */
.card {
    background-color: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--glow-color);
}

/* --- Button Styles --- */
.cta-button {
    transition: all 0.3s ease;
    border-radius: 9999px;
    font-weight: bold;
    padding: 1rem 2.5rem;
    display: inline-block;
}

.cta-button.glow-on-hover {
    background-color: var(--accent-color);
    color: #0f172a;
    box-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color);
}

.cta-button.glow-on-hover:hover {
    background-color: var(--accent-hover-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--glow-color), 0 0 30px var(--glow-color);
}

/* --- Community CTA Section --- */
.cta-section {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* --- Footer --- */

/* === MULTILOGIN POPUP STYLES === */

/* Popup Overlay */
#multilogin-popup {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 9999;
}

/* Popup Container */
#multilogin-popup .bg-gradient-to-br {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.95));
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(52, 211, 153, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: popupSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Popup Slide In Animation */
@keyframes popupSlideIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 100px, 0) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

/* Pulsing Background Effect */
#multilogin-popup .animate-pulse {
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

/* Fire Icon Bounce Animation */
#multilogin-popup .animate-bounce {
    animation: fireIconBounce 2s infinite;
}

@keyframes fireIconBounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0) scale(1.05);
    }
    70% {
        transform: translate3d(0, -4px, 0) scale(1.02);
    }
    90% {
        transform: translate3d(0, -2px, 0) scale(1.01);
    }
}

/* Gradient Text Effect */
#multilogin-popup .text-gradient-popup {
    background: linear-gradient(90deg, #34d399, #60a5fa, #a78bfa);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Code Box Glow Effect */
#multilogin-popup .bg-slate-700 {
    position: relative;
    overflow: hidden;
}

#multilogin-popup .bg-slate-700::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.4), transparent);
    animation: codeGlow 3s infinite;
}

@keyframes codeGlow {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* CTA Button Enhanced Animation */
#multilogin-popup .bg-gradient-to-r:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(52, 211, 153, 0.4);
}

/* Countdown Timer Urgency Effect */
#countdown {
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    animation: urgencyPulse 1s ease-in-out infinite alternate;
}

@keyframes urgencyPulse {
    0% { 
        transform: scale(1);
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    }
    100% { 
        transform: scale(1.05);
        text-shadow: 0 0 15px rgba(239, 68, 68, 1);
    }
}

/* Close Button Hover Effect */
#close-popup:hover {
    transform: rotate(90deg) scale(1.1);
    color: #ef4444;
}

/* Copy Button Success Animation */
.copy-success {
    animation: copySuccess 0.6s ease-out;
}

@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- Preload fix: hide until minimal CSS/JS ready to avoid mobile-first flash --- */
.preload-fix {
    /* kept for backward-compat; intentionally no-op to avoid hiding entire page */
}

/* Visually hidden helper (used for schema/logo hidden markup) */
.visually-hidden { 
    position: absolute !important; 
    width: 1px !important; 
    height: 1px !important; 
    padding: 0 !important; 
    margin: -1px !important; 
    overflow: hidden !important; 
    clip: rect(0 0 0 0) !important; 
    white-space: nowrap !important; 
    border: 0 !important; 
}

/* Maps iframe styling moved from inline styles */
.maps-embed {
    border: 0 !important;
    width: 100%;
    height: 300px;
}

/* Global preload guard: hide initial render until the page marks itself ready.
   We use a class on the <html> element so we don't need to edit every <body>.
   The small inline script inserted before </head> will add the class quickly. */
/* NOTE: previously we hid the entire document until preload-done which could
   leave the site completely blank if the class never applied (see user report).
   Change to a safer, scoped guard: only hide header/nav/hero regions that are
   most likely to produce a mobile->desktop flash. This prevents a full blank
   page while keeping the UX improvement for the critical header area. */
html:not(.preload-done) .header,
html:not(.preload-done) .nav,
html:not(.preload-done) .hero {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
}

/* Short transition so elements unhide smoothly when .preload-done is added */
.header, .nav, .hero {
    transition: opacity 220ms ease, transform 220ms ease;
}

/* Responsive Adjustments for Mobile */
@media (max-width: 640px) {
    #multilogin-popup .max-w-md {
        max-width: 90vw;
        margin: 1rem;
    }
    
    #multilogin-popup .p-8 {
        padding: 1.5rem;
    }
    
    #multilogin-popup .text-2xl {
        font-size: 1.5rem;
    }
    
    #multilogin-popup .text-xl {
        font-size: 1.25rem;
    }
}

/* Glassmorphism Enhancement for Popup */
#multilogin-popup .bg-gradient-to-r.from-green-400 {
    background: linear-gradient(45deg, 
        rgba(52, 211, 153, 0.2), 
        rgba(59, 130, 246, 0.2)
    );
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

/* Enhanced Benefits List */
#multilogin-popup .text-left p {
    position: relative;
    padding-left: 1.5rem;
    transition: all 0.3s ease;
}

#multilogin-popup .text-left p:hover {
    transform: translateX(0.15rem);
}

/* --- Sticky / Fixed Header Helpers --- */
:root {
    --header-height: 4.5rem; /* default header height (~72px) */
}

/* Use sticky by default so header stays in flow; fallback to fixed behavior if needed */
.header {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-height);
    display: block;
}

/* When converting to fixed (optional), you can add .header--fixed on body to switch
   and the content padding will adapt automatically. */
body.header-fixed .header {
    position: fixed;
    left: 0;
    right: 0;
}

/* Shrinked state when scrolled */
.header--scrolled {
    box-shadow: 0 8px 30px rgba(2,6,23,0.55);
    background: rgba(15,23,42,0.95);
    transition: background 180ms ease, box-shadow 180ms ease, height 180ms ease, padding 180ms ease;
}

/* Ensure main content isn't covered by fixed/sticky header */
main#main-content {
    padding-top: var(--header-height);
}

/* Responsive adjustments: smaller header on mobile */
@media (max-width: 768px) {
    :root { --header-height: 5.25rem; } /* mobile header includes extra vertical space for stacked items */
}

@media (min-width: 769px) {
    :root { --header-height: 4.5rem; }
}

/* Shimmer Effect for Discount Badge */
.discount-shimmer {
    position: relative;
    overflow: hidden;
}

.discount-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* === END MULTILOGIN POPUP STYLES === */
.footer {
    background-color: #000000;
    color: var(--secondary-text-color);
    padding: 4rem 1rem;
    border-top: 1px solid var(--border-color);
}

.footer h3 {
    color: var(--primary-text-color);
}

.footer a:hover {
    color: var(--accent-color);
}

/* --- General Text Colors --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-text-color);
}
p, span, li {
    color: var(--secondary-text-color);
}
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-hover-color);
}
strong {
    color: var(--primary-text-color);
}

/* Dấu ngoặc nhọn thừa đã được xóa khỏi đây */
/* --- Nâng cấp cho hình ảnh Blog (Thêm Lớp Phủ) --- */
.card-image-wrapper {
    position: relative;
    overflow: hidden; /* Đảm bảo các góc bo được áp dụng */
}

/* Lớp phủ tối mặc định */
.card-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2));
    transition: opacity 0.3s ease-in-out;
}

/* Khi di chuột vào card, lớp phủ mờ đi, ảnh sáng lên */
.card:hover .card-image-wrapper::after {
    opacity: 0.5;
}

/* --- Article & Heading Spacing --- */
article h1, article h2, article h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}
article ul, article ol {
    margin-bottom: 1.5rem;
}
article figure {
    margin-bottom: 1.5rem;
}
article figcaption {
    color: var(--secondary-text-color);
    font-size: 0.95em;
    text-align: center;
    margin-top: 0.5rem;
}

/* --- Responsive Layout --- */
@media (max-width: 768px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .max-w-4xl {
        max-width: 100%;
        padding: 1rem;
    }
    .header, .footer {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .card, article {
        padding: 1rem;
    }
    .cta-section, .cta-button {
        padding: 0.75rem 1.5rem;
    }
}

/* --- List Style for Articles --- */
article ul {
    list-style-type: disc;

/* --- Coupon reveal styles (CSS-only) --- */
.coupon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.coupon-mask {
    display: inline-block;
    background: linear-gradient(90deg,#00000010,#00000005);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.06em;
}
.coupon-dots {
    margin-left: 0.2rem;
    opacity: 0.9;
}
.coupon-full {
    display: none;
    font-weight: 800;
}
.coupon-cta { font-size: 0.95rem; color: var(--primary-text-color); }

/* When checkbox #reveal-coupon is checked, show full coupon and hide mask */
#reveal-coupon:checked + section .coupon-mask {
    display: none;
}
#reveal-coupon:checked + section .coupon-full {
    display: inline-block;
}

    padding-left: 1.5rem;
}

/* Small helpers moved from inline styles */
.logo-accent {
    color: var(--accent-color);
}
.visually-hidden {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}
.maps-embed {
    border: 0;
}
/* Sticky header (Jekyll _includes/header.html uses class="header") */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  background: rgba(15,23,42,0.75); /* giữ theme hiện tại, điều chỉnh nếu muốn */
}

/* Ensure main content not hidden under header
   Adjust padding-top to match header height on your layout */
main#main-content {
  padding-top: 4.5rem; /* ~72px, chỉnh theo thực tế */
}

/* Optional: nicer transition/shadow when scrolled (works without JS if you prefer fixed+class via JS) */
.header--scrolled {
  box-shadow: 0 8px 30px rgba(2,6,23,0.55);
  background: rgba(15,23,42,0.9);
  transition: background 180ms ease, box-shadow 180ms ease;
}