/**
 * styles.css
 * Global styles cho TikTok Live Game SaaS Platform
 *
 * Theme: Dark mode với gradient accents
 * Design: Modern, glassmorphism, micro-animations
 */

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(25, 25, 35, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    /* TikTok-inspired colors */
    --accent-pink: #fe2c55;
    --accent-cyan: #25f4ee;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;

    /* Gradients */
    --gradient-primary: linear-gradient(
            135deg,
            var(--accent-pink),
            var(--accent-purple)
    );
    --gradient-secondary: linear-gradient(
            135deg,
            var(--accent-cyan),
            var(--accent-blue)
    );
    --gradient-bg: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 100%);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(254, 44, 85, 0.5);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(254, 44, 85, 0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(254, 44, 85, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(254, 44, 85, 0.6);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   HEADER
   ========================================== */
.header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.9);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent-pink);
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    padding: 80px 0;
    text-align: center;
    animation: fadeIn 0.8s ease;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================
   GLASSMORPHISM CARD
   ========================================== */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(254, 44, 85, 0.3);
    box-shadow: var(--shadow-glow);
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 4px rgba(254, 44, 85, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:read-only {
    opacity: 0.8;
    cursor: default;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(254, 44, 85, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(254, 44, 85, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-cyan);
    background: rgba(37, 244, 238, 0.1);
}

.btn-copy {
    background: var(--gradient-secondary);
    color: var(--bg-primary);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(37, 244, 238, 0.5);
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================
   GAME SELECTION CARDS
   ========================================== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(254, 44, 85, 0.4);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card.selected {
    border-color: var(--accent-pink);
    box-shadow: 0 0 30px rgba(254, 44, 85, 0.3);
}

.game-card.selected::before {
    opacity: 1;
}

.game-card-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 16px;
}

.game-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.game-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.game-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

/* ==========================================
   OUTPUT SECTION
   ========================================== */
.output-section {
    display: none;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease;
}

.output-section.visible {
    display: block;
}

.output-label {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent-cyan);
}

.output-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.output-input {
    flex: 1;
    padding: 14px 18px;
    background: var(--bg-primary);
    border: 2px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    color: var(--accent-cyan);
    font-family: "Fira Code", monospace;
    font-size: 0.95rem;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
}

/* ==========================================
   UTILITIES
   ========================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    color: var(--accent-cyan);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================
   GIFT TABLE (Horse Racing card)
   ========================================== */
.gift-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: fixed;
}

.gift-table th {
    font-size: 1rem;
    padding: 4px 2px;
    text-align: center;
    color: var(--text-secondary);
}

.gift-table td {
    padding: 3px 2px;
    text-align: center;
    font-size: 1.1rem;
    cursor: default;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.gift-table td:hover {
    background: rgba(255, 255, 255, 0.07);
}

.gift-table .tier-cost {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: "Fira Code", monospace;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0;
    }

    .glass-card {
        padding: 20px;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .output-wrapper {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
