/*
Theme Name: Help4x Pro
Theme URI: https://help4x.ru
Description: Современная темная тема для технического блога с киберпанк-эстетикой
Version: 1.0
Author: Help4x Team
Author URI: https://help4x.ru
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: help4x
Tags: blog, dark, tech, modern, responsive
*/

:root {
    --primary: #0a0e27;
    --secondary: #1a1f3a;
    --accent: #00d9ff;
    --accent-glow: rgba(0, 217, 255, 0.3);
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --border: #27273f;
    --card-bg: #13162e;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

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

body {
    font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--primary);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.03;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, var(--accent) 2px, var(--accent) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, var(--accent) 2px, var(--accent) 4px);
    background-size: 50px 50px;
    animation: slide 20s linear infinite;
    pointer-events: none;
}

@keyframes slide {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: -200px;
    right: -200px;
    animation: float 15s ease-in-out infinite;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #667eea;
    bottom: -150px;
    left: -150px;
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
.site-header {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: rgba(10, 14, 39, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.site-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    position: relative;
    text-decoration: none;
}

.site-logo::before {
    content: '>';
    position: absolute;
    left: -1.2rem;
    color: var(--accent);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

.main-navigation {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    list-style: none;
}

.main-navigation a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    display: block;
    padding: 0.5rem 0;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: var(--accent);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
    width: 100%;
}

.main-navigation .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    list-style: none;
}

.main-navigation li {
    position: relative;
}

.main-navigation li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-navigation .sub-menu a {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.main-navigation .sub-menu a:hover {
    background: rgba(0, 217, 255, 0.1);
}

/* Hero Section */
.hero-section {
    padding: 5rem 0 3rem;
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.hero-section h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
}

/* Search */
.search-container {
    max-width: 600px;
    margin: 0 auto 4rem;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.search-form {
    position: relative;
}

.search-field {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Onest', sans-serif;
    transition: all 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-submit {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-submit:hover {
    background: #00c4e6;
    box-shadow: 0 5px 20px var(--accent-glow);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:nth-child(2)::before {
    background: var(--gradient-2);
}

.post-card:nth-child(3)::before {
    background: var(--gradient-3);
}

.post-card:nth-child(4n)::before {
    background: var(--gradient-1);
}

.post-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-glow);
}

.post-card:hover::before {
    opacity: 1;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    flex-wrap: wrap;
}

.post-category {
    color: var(--accent);
}

.post-category a {
    color: var(--accent);
    text-decoration: none;
}

.post-card h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 700;
    line-height: 1.3;
}

.post-card h2 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-card h2 a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.read-more:hover {
    gap: 0.8rem;
}

.read-more::after {
    content: '→';
    transition: transform 0.3s ease;
}

.read-more:hover::after {
    transform: translateX(3px);
}

/* Single Post */
.single-post {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.single-post .entry-header {
    margin-bottom: 3rem;
    text-align: center;
}

.single-post .entry-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.single-post .entry-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.single-post .entry-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem;
    line-height: 1.8;
}

.single-post .entry-content p {
    margin-bottom: 1.5rem;
}

.single-post .entry-content h2,
.single-post .entry-content h3 {
    color: var(--text);
    margin: 2rem 0 1rem;
}

.single-post .entry-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.single-post .entry-content h3 {
    font-size: 1.5rem;
}

.single-post .entry-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.single-post .entry-content a:hover {
    border-bottom-color: var(--accent);
}

.single-post .entry-content code {
    background: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: var(--accent);
}

.single-post .entry-content pre {
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.single-post .entry-content pre code {
    background: transparent;
    padding: 0;
}

/* Sidebar */
.sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

.widget {
    margin-bottom: 2rem;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.widget ul {
    list-style: none;
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.widget ul li a:hover {
    color: var(--accent);
}

/* Footer */
.site-footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    margin-top: 5rem;
    color: var(--text-muted);
}

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

.footer-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

.footer-navigation {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.footer-navigation a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
    list-style: none;
}

.pagination a,
.pagination span {
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination .current {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

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

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-top: 1rem;
        padding: 1rem;
        flex-direction: column;
    }

    .main-navigation.active {
        display: flex;
    }

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

    .single-post .entry-title {
        font-size: 2rem;
    }

    .single-post .entry-content {
        padding: 2rem 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .single-post .entry-title {
        font-size: 1.75rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
