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

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #5865F2;
    --secondary-color: #4CAF50;
    --dark-bg: #0a0a0a;
    --light-bg: #ffffff;
    --gray-bg: #f5f5f5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --hover-shadow: 0 4px 16px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --max-width: 1400px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #1a1a1a;
        --gray-bg: #2a2a2a;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #444444;
        --card-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--light-bg);
}

/* Typography */
h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; font-weight: 500; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: darken(var(--primary-color), 10%);
}

/* Loading spinner styles */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-spinner::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header Navigation */
.site-header {
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-speed);
}

.site-header.scrolled {
    box-shadow: var(--card-shadow);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
}

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

.logo-icon {
    font-size: 1.75rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background 0.3s;
}

.nav-link:hover {
    background: var(--gray-bg);
}

.nav-search {
    position: relative;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 200px;
    transition: width 0.3s;
}

.search-input:focus {
    outline: none;
    width: 250px;
    border-color: var(--primary-color);
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-speed);
}

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

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

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

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.btn-primary::before, .btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before, .btn-secondary:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

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

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

.btn-primary.large, .btn-secondary.large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 5rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="100" fill="white" opacity="0.05">☁</text></svg>') repeat;
    animation: float 20s infinite linear;
}

@keyframes float {
    from { transform: translateX(0); }
    to { transform: translateX(-100px); }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.4s both;
    position: relative;
    z-index: 1;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

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

.stat-item .stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.stat-item .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.content-section {
    margin-bottom: 4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.view-all {
    color: var(--primary-color);
    font-weight: 500;
}

/* Filter Tags */
.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.tag:hover, .tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Content Grid */
.content-grid, .featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
}

.featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

/* Cards */
.featured-card, .content-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--card-shadow);
    cursor: pointer;
}

.featured-card:hover, .content-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
}

.featured-card.large {
    grid-column: span 2;
}

.card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.featured-card:hover .card-image img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Game Cards Specific */
.game-card .card-image {
    position: relative;
}

.game-size {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.rating {
    color: #ffa500;
}

.players {
    color: var(--text-secondary);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-primary.small, .btn-secondary.small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.pricing-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    position: relative;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.pricing-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.plan-name {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.plan-price {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.plan-price span {
    font-size: 1rem;
    color: var(--text-secondary);
}

.plan-features {
    list-style: none;
    margin-bottom: 2rem;
}

.plan-features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

/* Steps Container */
.steps-container {
    display: flex;
    justify-content: space-around;
    margin-top: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.step-card {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.step-number {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.step-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-description {
    color: var(--text-secondary);
}

/* Guides List */
.guides-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guide-item {
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.guide-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow);
}

.guide-title {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.guide-excerpt {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.guide-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Community Stats */
.community-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    background: var(--gray-bg);
    margin-top: 4rem;
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 2rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-title {
    margin-bottom: 1rem;
}

.footer-heading {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    font-size: 1.5rem;
}

.social-links a {
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: translateY(-3px);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
}

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

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    color: var(--text-secondary);
}

/* Load More */
.load-more {
    text-align: center;
    margin: 2rem 0;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Improved Responsive Design */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 64px);
        background: var(--light-bg);
        flex-direction: column;
        padding: 2rem;
        transition: left var(--transition-speed);
        z-index: 99;
        box-shadow: var(--card-shadow);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-search {
        width: 100%;
    }

    .search-input {
        width: 100% !important;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

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

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

    .pricing-card.featured {
        transform: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .featured-card.large {
        grid-column: span 1;
    }

    .community-stats {
        grid-template-columns: 1fr 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .social-links {
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .steps-container {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .hero-section {
        padding: 3rem 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .community-stats {
        grid-template-columns: 1fr;
    }

    .filter-tags {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}