/* ============================================
   SHARED STYLES - TỐI ƯU HÓA
   Dùng chung cho tất cả trang landing
   ============================================
   Biến CSS → dễ tùy chỉnh
   Animation mượt → GPU-accelerated
   Responsive → hỗ trợ mọi màn hình
   ============================================ */

/* --- CSS Variables --- */
:root {
    --max-width: 550px;
    --btn-width: 90%;
    --transition-speed: 0.4s;
    --pulse-duration: 1.5s;
    --pulse-scale: 1.08;
}

/* --- Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: #000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
    /* Chống flicker trên mobile Safari */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ============================================
   LAYOUT CHÍNH
   ============================================ */
.app {
    background-size: 100% 100%;
    background-position: center top;
    background-repeat: no-repeat;
    height: 100vh;
    width: 100%;
    max-width: var(--max-width);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Tối ưu GPU rendering */
    transform: translateZ(0);
    will-change: background-image;
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    /* GPU-accelerated transition */
    opacity: 1;
    transition: opacity var(--transition-speed) ease-in-out;
    will-change: opacity;
}

.title {
    width: 100%;
}

.btn {
    width: var(--btn-width);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.text {
    width: 100%;
}

/* ============================================
   BUTTON ANIMATION (Pulse)
   ============================================ */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(var(--pulse-scale));
    }
}

.btn a {
    display: block;
    width: var(--btn-width);
    animation: pulse var(--pulse-duration) ease-in-out infinite;
    /* GPU-accelerated animation */
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    /* Cursor pointer để người dùng biết có thể click */
    cursor: pointer;
}

/* Xóa :hover pause để tránh lỗi kẹt hiệu ứng trên mobile (sticky hover) */

/* ============================================
   SPA TRANSITIONS
   ============================================ */
.content.fade-out {
    opacity: 0;
}

/* ============================================
   RESPONSIVE - Landscape Mobile
   ============================================ */
@media (max-height: 500px) {
    .app {
        height: 100vh;
        min-height: 100vh;
    }
    .btn a {
        animation: none; /* Tắt pulse trên màn hình nhỏ để tránh giật */
    }
}

/* ============================================
   RESPONSIVE - Desktop
   ============================================ */
@media (min-width: 551px) {
    body {
        background-color: #1a1a2e; /* Màu nền tối hai bên cho đẹp */
    }
    .app {
        border-radius: 12px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
        height: 100vh;
        max-height: 844px; /* iPhone 12/13/14 Pro max height */
    }
}

/* ============================================
   DARK MODE SUPPORT (tùy chọn)
   ============================================ */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0a0a1a;
    }
}

/* ============================================
   DEBUG LOG (ẩn mặc định)
   ============================================ */
#debug-log {
    color: #d00;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 12px;
    padding: 10px;
    background: #fff0f0;
    border: 1px solid #d00;
    display: none;
    position: relative;
    z-index: 99999;
    max-height: 200px;
    overflow-y: auto;
    word-break: break-all;
}

#debug-log hr {
    border: none;
    border-top: 1px solid #dcc;
}

