/* ===================================
   FILE: shared.css
   CSS dùng chung cho tất cả các trang
   =================================== */

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== HEADER / NAV ===== */
header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--box-border);
    padding: 12px 0;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-main);
    background: var(--nav-item-bg);
    border-radius: 12px;
    padding: 12px 20px;
    border: 1px solid var(--box-border);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    flex: 1;
    max-width: 180px;
}

.nav-item i {
    font-size: 1.2em;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.nav-text {
    opacity: 1;
    max-width: none;
    margin-left: 8px;
    font-weight: 700;
    font-size: 1.05em;
    letter-spacing: 0.5px;
}

.nav-item:hover {
    background: var(--highlight);
    border-color: var(--highlight);
    box-shadow: var(--glow-highlight);
    color: #fff;
    transform: translateY(-3px);
}

.nav-item:hover i {
    transform: scale(1.15) rotate(-5deg);
}

.nav-item.active {
    background: var(--nav-active);
    border-color: var(--nav-active);
    color: var(--nav-active-text);
    box-shadow: var(--glow-accent);
}

.nav-item.active:hover {
    color: var(--nav-active-text);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    text-align: center;
}

/* ===== HEADINGS ===== */
h1 {
    font-family: var(--font-title, var(--font-main));
    font-size: clamp(1.6em, 4vw, 2.4em);
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

h1+p {
    color: var(--text-sub);
    font-size: 1em;
    margin: 0 0 30px 0;
}

/* ===== BOXES GRID ===== */
.boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* ===== BOX CARD ===== */
.box {
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: 18px;
    padding: 24px 16px;
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(124, 77, 255, 0.05));
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.box:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--box-hover-bg);
    border-color: var(--accent);
    box-shadow: 0 16px 40px var(--box-shadow), var(--glow-accent);
}

.box:hover::before {
    opacity: 1;
}

.box img {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    margin-bottom: 14px;
    object-fit: cover;
    border: 2px solid rgba(0, 229, 255, 0.3);
    transition: transform 0.3s ease;
}

.box:hover img {
    transform: scale(1.08);
    border-color: var(--accent);
}

.box h3 {
    margin: 0 0 8px 0;
    color: var(--accent);
    font-size: 1.15em;
    font-weight: 700;
}

.box p {
    color: var(--text-sub);
    font-size: 0.9em;
    margin: 0;
    line-height: 1.5;
}

/* ===== ICON WRAPPER (trang phim) ===== */
.icon-wrapper {
    font-size: 2.8em;
    margin-bottom: 14px;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.box:hover .icon-wrapper {
    transform: scale(1.2);
    color: var(--highlight);
    filter: drop-shadow(0 0 8px currentColor);
}

/* ===== COIN DISPLAY ===== */
#coin-display {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 0.9em;
    color: #ffd700;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #ffd700;
    z-index: 10;
    white-space: nowrap;
}

/* ===== SNOWFLAKE ===== */
.snowflake {
    position: fixed;
    top: -20px;
    color: rgba(200, 235, 255, 0.7);
    pointer-events: none;
    z-index: 1;
    animation: fall linear forwards;
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.5);
    user-select: none;
}

@keyframes fall {
    to {
        transform: translateY(105vh) rotate(360deg);
    }
}

/* ===== BACK BUTTON ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: 50px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.back-btn:hover {
    background: var(--highlight);
    border-color: var(--highlight);
    box-shadow: var(--glow-highlight);
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .boxes {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 14px;
    }

    .box {
        padding: 18px 12px;
    }

    .box img {
        width: 70px;
        height: 70px;
    }

    nav {
        gap: 8px;
    }
}