/* 
 * Solitr.fun - Modern CSS Styling
 * Optimized for performance, accessibility, and SEO
 */

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.875rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
    margin-bottom: 1rem;
}

a {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #4f46e5;
}

strong {
    font-weight: 600;
    color: #6366f1;
}

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header & Navigation */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.logo img {
    border-radius: 8px;
}

.logo-text {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: #4b5563;
    transition: color 0.3s ease, transform 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: #6366f1;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 6rem 0 8rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 4px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.hero-title .brand-highlight {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.hero-title .subtitle {
    display: block;
    font-size: 0.6em;
    font-weight: 400;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    margin-top: 0.5rem;
}

.hero-description {
    font-size: 1.125rem;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    line-height: 1.7;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.hero-actions .btn {
    flex: 0 0 auto;
    min-width: 200px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    transform: translateY(0);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
    color: white !important;
    border: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.btn-accent:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    color: white !important;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
}

.stat-label {
    font-size: 0.875rem;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

.hero-game-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

/* Hero Illustration Styles */
.hero-illustration {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin-bottom: 1rem;
}

.hero-main-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.hero-main-image:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.illustration-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
    border-radius: 30px;
    animation: illustration-pulse 3s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes illustration-pulse {
    from {
        opacity: 0.3;
        transform: scale(0.95);
    }
    to {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.game-preview-card {
    position: relative;
    width: 300px;
    height: 200px;
    perspective: 1000px;
}

.card-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.card {
    position: absolute;
    width: 80px;
    height: 110px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: float 3s ease-in-out infinite;
}

.card-1 {
    top: 20px;
    left: 50px;
    animation-delay: 0s;
    z-index: 3;
}

.card-2 {
    top: 40px;
    left: 100px;
    animation-delay: 1s;
    z-index: 2;
}

.card-3 {
    top: 60px;
    left: 150px;
    animation-delay: 2s;
    z-index: 1;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

.preview-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.3) 0%, transparent 70%);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        opacity: 0.5;
    }
    to {
        opacity: 1;
    }
}

/* Section Styles */
section {
    padding: 5rem 0;
    position: relative;
}

.section-title {
    text-align: center;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Games Section */
.games-section {
    background: white;
    position: relative;
}

.games-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(102, 126, 234, 0.1), transparent);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.game-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.game-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-image img {
    transform: scale(1.05);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.play-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.play-icon {
    font-size: 1.2rem;
}

.game-content {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
}

.game-description {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.game-features {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.feature-tag {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Features Section */
.features-section {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.feature-description {
    color: #6b7280;
    line-height: 1.6;
}

/* How to Play Section */
.how-to-play-section {
    background: white;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.instruction-card {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.instruction-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.instruction-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.instruction-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.faq-grid {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.faq-question {
    padding: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    position: relative;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: #6366f1;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #6366f1;
    transition: transform 0.3s ease;
}

.faq-item.open .faq-question::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 200px;
    padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #d1d5db;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fbbf24;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
}

.copyright {
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.copyright a {
    color: #d1d5db;
}

.separator {
    margin: 0 0.5rem;
    color: #6b7280;
}

.footer-tagline {
    color: #d1d5db;
    font-size: 0.875rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-actions .btn {
        flex: 1 1 auto;
        min-width: 180px;
        max-width: 220px;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-illustration {
        max-width: 380px;
    }
    
    .game-preview-card {
        width: 250px;
        height: 160px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Mobile menu can be implemented later */
    }
    
    .hero {
        padding: 4rem 0 6rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .hero-actions .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
        min-width: 250px;
        justify-content: center;
    }
    
    .hero-stats {
        gap: 1rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .nav-container {
        padding: 0 0.75rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .game-card {
        margin: 0 0.5rem;
    }
    
    .feature-item,
    .instruction-card {
        padding: 1.5rem;
    }
}

/* Performance Optimizations */
.game-image img,
.card,
.btn,
.game-card,
.feature-item {
    will-change: transform;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.nav-link:focus,
.play-btn:focus,
.faq-question:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .hero,
    .footer {
        display: none;
    }
    
    .games-section,
    .features-section,
    .how-to-play-section,
    .faq-section {
        page-break-inside: avoid;
    }
}
