/* MatesDivertidas - Main Stylesheet */
:root {
    --primary: #EF4444;
    --secondary: #F59E0B;
    --accent: #10B981;
    --dark: #1E293B;
    --light-bg: #FEF2F2;
    --card-bg: #FFFFFF;
    --text: #334155;
    --text-light: #64748B;
    --border: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--light-bg);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--dark);
}

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

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

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 1rem 2rem;
}

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

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--primary);
    color: white;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--dark);
    border-radius: 3px;
    transition: 0.3s;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.mobile-menu.active { display: block; }

.mobile-menu a {
    display: block;
    padding: 1rem;
    color: var(--dark);
    border-bottom: 1px solid var(--border);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 15s infinite linear;
}

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

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: 0.3s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--dark);
    color: white;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid white;
    color: white;
}

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

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

.btn-accent:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Math Animations in Hero */
.math-symbols {
    position: absolute;
    font-size: 2rem;
    color: rgba(255,255,255,0.15);
    animation: drift 20s infinite linear;
}

@keyframes drift {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* Sections */
.section {
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Game Cards */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: 0.3s;
    cursor: pointer;
}

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

.game-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.game-card-content { padding: 1.5rem; }

.game-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.game-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

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

.difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.difficulty.easy { background: #D1FAE5; color: #065F46; }
.difficulty.medium { background: #FEF3C7; color: #92400E; }
.difficulty.hard { background: #FEE2E2; color: #991B1B; }

.category-tag {
    background: var(--light-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: 0.3s;
}

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

.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card-content { padding: 1.5rem; }

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.article-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    background: var(--dark);
    padding: 3rem 2rem;
    border-radius: 1rem;
    margin: 2rem 0;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--secondary);
}

.stat-label { opacity: 0.8; }

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--accent), #059669);
    padding: 3rem 2rem;
    border-radius: 1rem;
    text-align: center;
    color: white;
}

.newsletter h3 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.newsletter-form input {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    width: 300px;
    font-size: 1rem;
}

.newsletter-form button {
    padding: 1rem 2rem;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.newsletter-form button:hover {
    background: var(--primary);
}

/* FAQ */
.faq-item {
    background: var(--card-bg);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.faq-question:hover { background: var(--light-bg); }

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: 0.3s;
}

.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 500px;
}

/* Contact Form */
.contact-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.3s;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea { resize: vertical; min-height: 150px; }

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li { margin-bottom: 0.75rem; }

.footer-section a {
    color: rgba(255,255,255,0.7);
    transition: 0.3s;
}

.footer-section a:hover {
    color: var(--secondary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.filter-bar input {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.filter-bar select {
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

/* Game Page Specific */
.game-container {
    max-width: 900px;
    margin: 0 auto;
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.game-instructions {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.game-instructions h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.game-area {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.score-display {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--primary);
}

/* Related Games Sidebar */
.related-games {
    margin-top: 3rem;
}

.related-games h3 {
    margin-bottom: 1.5rem;
}

.related-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Article Page */
.article-container {
    max-width: 800px;
    margin: 0 auto;
}

.article-hero {
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.article-hero img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.article-header {
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-sidebar {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.table-of-contents h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.table-of-contents ul {
    list-style: none;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--border);
}

.table-of-contents a:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    background: var(--light-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 6rem 2rem;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Poppins', sans-serif;
}

.error-page h1 { margin-bottom: 1rem; }
.error-page p { color: var(--text-light); margin-bottom: 2rem; }

/* Legal Pages */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.legal-content h1 { margin-bottom: 2rem; }
.legal-content h2 { margin-top: 2rem; margin-bottom: 1rem; color: var(--primary); }
.legal-content p { margin-bottom: 1rem; }
.legal-content ul { margin-bottom: 1rem; padding-left: 2rem; }

/* About Page */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    border-radius: 1rem;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: auto;
}

/* Search Results */
.search-highlight {
    background: #FEF08A;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    
    .section-title h2 { font-size: 1.75rem; }
    
    .games-grid, .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .stats { grid-template-columns: repeat(2, 1fr); }
    
    .newsletter-form input { width: 100%; }
    
    .about-grid { grid-template-columns: 1fr; }
    
    .footer-content { grid-template-columns: 1fr; }
    
    .article-hero img { height: 250px; }
    
    .filter-bar { flex-direction: column; }
    .filter-bar input, .filter-bar select { width: 100%; }
}

/* Print Styles */
@media print {
    .navbar, .footer, .newsletter { display: none; }
}
