/* ============================================
   SQUARYX - Enterprise Topup Website
   Clean Blue Innovation Design System
   ============================================ */

/* CSS Variables */
:root {
    /* Colors - Clean Blue Theme */
    --color-bg: #f8f9fc;
    --color-bg-elevated: #ffffff;
    --color-bg-card: #ffffff;
    --color-bg-card-hover: #fefefe;
    
    --color-text-primary: #0f172a;
    --color-text-secondary: rgba(15, 23, 42, 0.7);
    --color-text-tertiary: rgba(15, 23, 42, 0.5);
    
    --color-accent: #2563eb;
    --color-accent-light: #3b82f6;
    --color-accent-dark: #1d4ed8;
    --color-accent-glow: rgba(37, 99, 235, 0.15);
    
    --color-surface: rgba(37, 99, 235, 0.04);
    --color-border: rgba(15, 23, 42, 0.06);
    --color-border-hover: rgba(15, 23, 42, 0.12);
    
    /* Gradients */
    --gradient-accent: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    --gradient-soft: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    
    /* Typography */
    --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 64px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px var(--color-accent-glow);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-lg) 0;
    background: rgba(248, 249, 252, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.logo {
    font-size: 1.375rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

/* Desktop Navigation */
.nav-links {
    display: none;
    align-items: center;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
    
    .menu-toggle {
        display: none !important;
    }
}

.nav-link {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text-primary);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
    font-weight: var(--font-weight-bold);
    color: white;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

.nav-btn:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    width: 44px;
    height: 44px;
    gap: 5px;
    padding: 0;
    transition: opacity var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
    opacity: 0.7;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: rgba(248, 249, 252, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: var(--space-2xl);
    gap: var(--space-lg);
}

.mobile-link {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    transition: color var(--transition-fast);
}

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

.mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-2xl);
    margin-top: var(--space-md);
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: white;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.mobile-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-4xl) var(--space-lg);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.5;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.hero-title {
    margin-bottom: 36px;
}

.title-line {
    display: block;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: var(--font-weight-extrabold);
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.title-line:nth-child(2) {
    animation-delay: 0.1s;
}

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

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: var(--font-weight-regular);
    color: var(--color-text-secondary);
    margin-bottom: 36px;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.btn-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px var(--color-accent-glow);
}

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

.btn-secondary:hover {
    background: var(--color-bg-card);
    border-color: var(--color-border-hover);
}

/* Hero Visual */
.hero-visual {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    display: none;
}

@media (min-width: 1024px) {
    .hero-visual {
        display: block;
    }
}

.hero-card {
    position: relative;
    width: 200px;
    height: 240px;
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    animation: cardFloat 6s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0) rotate(3deg);
    }
    50% {
        transform: translateY(-20px) rotate(-3deg);
    }
}

.card-glow {
    position: absolute;
    inset: -2px;
    background: var(--gradient-accent);
    border-radius: var(--radius-xl);
    opacity: 0.15;
    filter: blur(20px);
    z-index: -1;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--space-xl);
}

.card-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.card-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.card-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
}

/* ============================================
   Games Section
   ============================================ */
.games-section {
    padding: 48px 0 64px;
    background: var(--gradient-soft);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0em;
    color: var(--color-text-primary);
}

.section-icon {
    width: 1em;
    height: 1em;
    color: #f97316;
}

.games-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    padding: var(--space-xl);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-bg-card);
    max-width: 1200px;
    margin: 0 auto;
}

/* Game Card - Horizontal Layout */
.game-card {
    position: relative;
    display: flex;
    align-items: center;
    width: 480px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.game-card[data-game="mlbb"] {
    background: linear-gradient(60deg, #ffffff, rgba(63, 170, 255, 0.10), #ffffff, rgba(63, 170, 255, 0.10), #ffffff);
    background-size: 400% 400%;
    animation: gradientMove 10s linear infinite;
}

.game-card[data-game="magic-chess"] {
    background: linear-gradient(60deg, #ffffff, rgba(232, 38, 11, 0.10), #ffffff, rgba(232, 38, 11, 0.10), #ffffff);
    background-size: 400% 400%;
    animation: gradientMove 10s linear infinite;
}

@keyframes gradientMove {
    from {
        background-position: 100% 100%;
    }
    to {
        background-position: 0% 0%;
    }
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-border-hover);
}

.game-card-bg {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.game-card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.game-card:hover .game-card-bg img {
    /* no zoom */
}

.game-card-overlay {
    display: none;
}

.game-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 0 var(--space-lg);
    flex: 1;
}

.game-name {
    font-size: 1.375rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.game-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-accent);
    padding: 6px 14px;
    background: var(--color-accent-glow);
    border-radius: var(--radius-full);
    letter-spacing: 0.03em;
}

.game-tag svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ============================================
   Features Section
   ============================================ */
.features-section {
    padding: 96px 0 var(--space-4xl);
    background: var(--color-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.feature-card {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.feature-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
}

.feature-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
}

.feature-desc {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    line-height: 1.6;
}

/* ============================================
   Stats Section
   ============================================ */
.stats-section {
    padding: var(--space-3xl) 0;
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.stats-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2xl);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: var(--space-lg);
}

.stat-number {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: var(--font-weight-extrabold);
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-plus,
.stat-percent {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-accent);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-tertiary);
    margin-top: var(--space-xs);
    letter-spacing: 0.05em;
}

.stat-divider {
    width: 1px;
    height: 60px;
    background: var(--color-border);
}

@media (max-width: 640px) {
    .stat-divider {
        display: none;
    }
    
    .stats-grid {
        gap: var(--space-lg);
    }
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: var(--space-xl) 0;
    background: rgba(248, 249, 252, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.copyright {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-tertiary);
}

.footer-right {
    display: flex;
    gap: var(--space-2xl);
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-title {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

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

.footer-link {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

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

/* ============================================
   Utility Classes
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.15);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.25);
}

/* Selection */
::selection {
    background: var(--color-accent);
    color: white;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: var(--space-md) 0;
    }

    .hero {
        padding: var(--space-3xl) var(--space-md);
        min-height: auto;
        padding-top: 160px;
        padding-bottom: 90px;
    }

    .hero-title {
        margin-bottom: 20px;
    }

    .hero-subtitle {
        margin-bottom: 24px;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
    }

    .games-section {
        padding: 36px 0 48px;
    }

    .section-header {
        margin-bottom: 36px;
    }

    .games-grid {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        padding: 0;
        border: none;
        background: transparent;
        border-radius: 0;
    }
    
    .game-card {
        flex-direction: column;
        width: 160px;
        height: auto;
        border-radius: var(--radius-lg);
    }
    
    .game-card-bg {
        width: 100%;
        height: 160px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .game-card-bg img {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .game-card-content {
        padding: var(--space-md) var(--space-md) var(--space-lg);
        text-align: center;
        align-items: center;
    }
    
    .game-name {
        font-size: 0.9rem;
    }
    
    .game-tag {
        font-size: 0.6rem;
        padding: 4px 8px;
    }
    
    .features-section {
        padding-top: 64px;
    }

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

    .feature-card {
        padding: var(--space-xl);
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-lg);
    }

    .copyright {
        order: 2;
        text-align: center;
        width: 100%;
    }

    .footer-right {
        order: 1;
        flex-direction: column;
        gap: var(--space-lg);
        width: 100%;
    }

    .footer-section {
        align-items: center;
        text-align: center;
    }
}

/* Loading State Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.loading {
    background: linear-gradient(
        90deg,
        var(--color-bg-card) 25%,
        var(--color-bg-card-hover) 50%,
        var(--color-bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}