/* ===================================
   GameMaster Hub - Enhanced Styles
   Gaming Guides & Strategy Resource
   =================================== */

/* ===================================
   CSS Reset & Base Styles
   =================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1f2937;
    background-color: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Image Loading Optimization */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    max-width: 100%;
    height: auto;
}

/* ===================================
   Common Variables & Utilities
   =================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center { text-align: center; }
.text-primary { color: #3b82f6; }
.text-secondary { color: #6b7280; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

/* ===================================
   Buttons
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===================================
   Header & Navigation
   =================================== */

.site-header {
    background-color: #1f2937;
    padding: 1rem 0;
    border-bottom: 1px solid #374151;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-wrapper {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.logo {
    display: flex !important;
    align-items: center !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    margin-right: auto !important;
}

.logo img {
    height: 32px !important;
    width: auto !important;
    margin-right: 10px !important;
    object-fit: contain !important;
}

/* Логотип иконка */
.logo-icon {
    width: 32px !important;
    height: 32px !important;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    margin-right: 12px !important;
}

.logo-icon span {
    color: white !important;
    font-size: 16px !important;
    font-weight: 800 !important;
}

/* Текст логотипа */
.logo-text {
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    color: white !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.nav-menu {
    display: flex !important;
    gap: 2rem !important;
    list-style: none !important;
    margin-left: auto !important;
    margin-right: 0 !important;
}

.nav-menu li a {
    color: #d1d5db !important;
    font-weight: 500 !important;
    padding: 0.5rem 0 !important;
    position: relative !important;
    transition: color 0.3s ease !important;
    text-decoration: none !important;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: #3b82f6 !important;
}

.nav-menu li a.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background-color: #3b82f6;
}

/* Стили для активной ссылки */
.nav-menu li a.active {
    color: #3b82f6 !important;
}

.nav-menu li a:hover {
    color: #3b82f6 !important;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* ===================================
   Main Content
   =================================== */

#main-content {
    min-height: calc(100vh - 200px);
}

/* ===================================
   Page-Specific Styles
   =================================== */

/* Home Page */
body[data-page="home"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

body[data-page="home"] .hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 100px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

body[data-page="home"] .hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Guides Page */
body[data-page="guides"] {
    background: #f9fafb;
}

body[data-page="guides"] .guides-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 60px 0;
    color: white;
}

/* Strategies Page */
body[data-page="strategies"] {
    background: #0f172a;
    color: white;
}

body[data-page="strategies"] .strategies-header {
    background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
    padding: 80px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

/* News Page */
body[data-page="news"] {
    background: #f9fafb;
}

body[data-page="news"] .news-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    padding: 80px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

/* About Page */
body[data-page="about"] {
    background: white;
}

body[data-page="about"] .about-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 100px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Contact Page */
body[data-page="contact"] {
    background: #f9fafb;
}

body[data-page="contact"] .contact-header {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    padding: 100px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

/* ===================================
   Footer
   =================================== */

.site-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 4rem 0 0;
    margin-top: auto;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    max-width: 400px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.footer-logo .logo-icon span {
    color: white;
    font-size: 20px;
    font-weight: 800;
}

.footer-logo h3 {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.footer-description {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.footer-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: #60a5fa;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.footer-section h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 2rem;
    height: 2px;
    background: linear-gradient(90deg, #60a5fa, #8b5cf6);
    border-radius: 1px;
}

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

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

.footer-section ul li a {
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.footer-section ul li a:hover {
    color: #60a5fa;
    padding-left: 0.5rem;
}

.footer-section ul li a::before {
    content: '→';
    position: absolute;
    left: -1rem;
    opacity: 0;
    transition: all 0.3s ease;
    color: #60a5fa;
}

.footer-section ul li a:hover::before {
    opacity: 1;
    left: -0.5rem;
}

.newsletter-signup {
    margin-bottom: 2rem;
}

.newsletter-signup p {
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    background-color: #1f2937;
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.newsletter-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.newsletter-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.newsletter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #374151, #4b5563);
    color: #ffffff;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.social-links a:hover::before {
    left: 100%;
}

.social-links a:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(96, 165, 250, 0.3);
}

.footer-bottom {
    background-color: #0f172a;
    padding: 2rem 0;
    border-top: 1px solid #374151;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-tagline {
    color: #60a5fa !important;
    font-style: italic;
    margin-top: 0.25rem !important;
}

.footer-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: linear-gradient(135deg, #374151, #4b5563);
    color: #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #4b5563;
}

/* ===================================
   Mobile Responsiveness
   =================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-brand {
        max-width: none;
    }
    
    .footer-stats {
        justify-content: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-badges {
        justify-content: center;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #1f2937;
        border-top: 1px solid #374151;
        padding: 1rem 0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        text-align: center;
        margin-bottom: 1rem;
    }

    .nav-menu li:last-child {
        margin-bottom: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }
    
    /* Responsive text sizes */
    body[data-page="home"] .hero-section h1 {
        font-size: 2.5rem !important;
    }
    
    body[data-page="guides"] .guides-header h1 {
        font-size: 2rem !important;
    }
    
    body[data-page="strategies"] .strategies-header h1 {
        font-size: 2.5rem !important;
    }
    
    body[data-page="news"] .news-header h1 {
        font-size: 2.5rem !important;
    }
    
    body[data-page="about"] .about-header h1 {
        font-size: 2.5rem !important;
    }
    
    body[data-page="contact"] .contact-header h1 {
        font-size: 2.5rem !important;
    }
}

/* ===================================
   Accessibility
   =================================== */

.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;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===================================
   Cookie Consent
   =================================== */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1f2937;
    color: #ffffff;
    padding: 1rem;
    z-index: 1000;
    border-top: 1px solid #374151;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-content p {
    margin: 0;
    flex: 1;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cookie-link {
    color: #3b82f6;
    text-decoration: none;
}

.cookie-link:hover {
    text-decoration: underline;
}

/* Hide cookie consent when accepted */
.cookie-consent.hidden {
    display: none;
}

/* ===================================
   Utility Classes
   =================================== */

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-4-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-2-cols,
    .grid-3-cols,
    .grid-4-cols {
        grid-template-columns: 1fr;
    }
}

/* Card styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}