/*
Theme Name: APK Portal Theme
Theme URI: https://androidnonstop.online
Description: Современная WordPress тема для портала с APK приложениями. Оптимизирована под SEO, адаптивная верстка, Schema.org разметка.
Version: 1.0.0
Author: AndroidNonStop
Author URI: https://androidnonstop.online
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apk-portal
Tags: android, apk, applications, portfolio, blog, responsive
*/

/* ==========================================================================
   БАЗОВЫЕ СТИЛИ
   ========================================================================== */

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

:root {
    --primary-color: #4A90E2;
    --secondary-color: #2C3E50;
    --accent-color: #27AE60;
    --text-color: #333333;
    --light-gray: #F8F9FA;
    --border-color: #E1E4E8;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

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

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

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
    position: relative;
    padding: 80px 0;
    text-align: center;
    background-color: var(--secondary-color, #2C3E50);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section.hero-home {
    padding-top: 60px;
    padding-bottom: 80px;
}

/* Затемнение/оверлей */
.hero-section .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--hero-overlay-color, #000000);
    opacity: var(--hero-overlay-opacity, 0.5);
    z-index: 1;
}

.hero-section > * {
    position: relative;
    z-index: 2;
}

.hero-section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--hero-h1-color, #FFFFFF);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--hero-description-color, #FFFFFF);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-align: center;
}

.hero-description p {
    margin-bottom: 10px;
}

/* Responsive hero */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
        min-height: 350px;
    }
    
    .hero-title {
        font-size: 2rem;
        padding: 0 15px;
    }
    
    .hero-description {
        font-size: 1rem;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 30px 0;
        min-height: 300px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
}

/* Content section */
.content-section {
    padding: 40px 0;
}

.content-section h2 {
    margin-bottom: 20px;
    color: var(--content-headings-color, var(--secondary-color));
}

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

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

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

/* ==========================================================================
   HEADER (ШАПКА)
   ========================================================================== */

.site-header {
    background: var(--nav-bg, #FFFFFF);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.site-logo img {
    height: 50px;
    width: auto;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-navigation a {
    font-weight: 500;
    color: var(--text-color);
    padding: 8px 0;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

/* ==========================================================================
   ГЛАВНАЯ СТРАНИЦА - КАТЕГОРИИ И ПЛИТКИ
   ========================================================================== */

.category-section {
    margin: 40px 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
}

.category-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--content-headings-color, var(--secondary-color));
}

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

.apps-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0 -10px;
}

.apps-grid > * {
    flex: 0 0 auto;
    width: calc((100% - 100px) / 6);
    margin: 0 10px;
    box-sizing: border-box;
}

/* ==========================================================================
   КАРТОЧКА ПРИЛОЖЕНИЯ (ПЛИТКА)
   ========================================================================== */

.app-card {
    background: var(--card-bg, #FFFFFF);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
}

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

.app-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.app-card-image-wrapper {
    width: 100%;
    height: 180px;
    min-height: 180px;
    overflow: hidden;
    background: var(--card-image-bg, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.app-card-image-wrapper img.app-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    display: block;
}

.app-card-image-wrapper .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--card-placeholder-gradient-start, #667eea) 0%, var(--card-placeholder-gradient-end, #764ba2) 100%);
    color: var(--card-bg, #FFFFFF);
    font-size: 48px;
    font-weight: bold;
    border-radius: 8px;
}

.app-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-card-content {
    padding: 15px;
}

.app-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--card-title-color, var(--content-headings-color, var(--secondary-color)));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.app-card-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    gap: 10px;
    flex-wrap: wrap;
}

.app-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--card-text-color, var(--content-text-color, var(--text-color)));
}

.rating-number {
    color: var(--card-text-color, var(--content-text-color, var(--text-color)));
}

.stars {
    color: #FFA500;
    font-size: 14px;
}

.app-badges {
    display: flex;
    gap: 5px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-free {
    background: var(--card-badge-primary, var(--hero-button-1-color, var(--primary-color)));
    color: var(--card-bg, #FFFFFF);
}

.badge-free-corner {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: var(--card-badge-primary, var(--hero-button-1-color, var(--primary-color)));
    color: var(--card-bg, #FFFFFF);
}

.badge-mod {
    background: var(--card-badge-secondary, var(--hero-button-2-color, var(--secondary-color)));
    color: var(--card-bg, #FFFFFF);
}

.badge-updated {
    background: var(--card-badge-primary, var(--hero-button-1-color, var(--primary-color)));
    color: var(--card-bg, #FFFFFF);
}

/* ==========================================================================
   СТРАНИЦА ПРИЛОЖЕНИЯ (SINGLE POST)
   ========================================================================== */

.single-app-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin: 30px 0;
}

.app-main-content {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Hero секция приложения */
.app-hero {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.app-icon {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.app-hero-info h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.app-rating-large {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.rating-stars {
    color: #FFA500;
    font-size: 24px;
}

.rating-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.download-button {
    display: inline-block;
    background: var(--accent-color);
    color: var(--white);
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    text-align: center;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.download-button:hover {
    background: #229954;
    transform: scale(1.05);
    color: var(--white);
}

.app-params {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.app-params li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.param-icon {
    font-size: 18px;
}

.param-label {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Хлебные крошки */
.breadcrumbs {
    padding: 15px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumbs a {
    color: var(--primary-color);
}

.breadcrumbs span {
    margin: 0 8px;
}

/* Описание приложения */
.app-description {
    line-height: 1.8;
    margin: 30px 0;
}

.app-description h2 {
    font-size: 24px;
    margin: 30px 0 15px;
    color: var(--secondary-color);
}

.app-description p {
    margin-bottom: 15px;
}

/* Похожие приложения */
.related-apps {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.related-apps h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

/* Комментарии */
.comments-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   САЙДБАР
   ========================================================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--secondary-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* ==========================================================================
   ФУТЕР
   ========================================================================== */

.site-footer {
    background: var(--footer-bg, #2C3E50);
    color: var(--footer-text-color, #FFFFFF);
    margin-top: 60px;
    padding: 40px 0 20px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

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

.footer-widget a {
    color: var(--footer-text-color, #FFFFFF);
    opacity: 0.8;
    display: block;
    padding: 5px 0;
}

.footer-widget a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--footer-lines-color, rgba(255,255,255,0.1));
    font-size: 14px;
    color: var(--footer-text-color, rgba(255,255,255,0.7));
}

/* ==========================================================================
   404 СТРАНИЦА
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 h1 {
    font-size: 120px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.error-404 h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

/* ==========================================================================
   АДАПТИВНОСТЬ
   ========================================================================== */

@media (max-width: 768px) {
    .main-navigation ul {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation.active ul {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px;
        box-shadow: var(--shadow);
    }
    
    .apps-grid {
        gap: 15px;
    }
    
    .apps-grid > * {
        width: calc((100% - 30px) / 3);
    }
    
    .app-card {
        min-height: 240px;
        padding: 8px;
    }
    
    .app-card-image-wrapper {
        height: 140px;
        min-height: 140px;
        padding: 15px;
    }
    
    .app-card-image-wrapper img {
        width: 100%;
        height: 100%;
    }
    
    .single-app-container {
        grid-template-columns: 1fr;
    }
    
    .app-hero {
        grid-template-columns: 100px 1fr;
        gap: 20px;
    }
    
    .app-icon {
        width: 100px;
        height: 100px;
    }
    
    .app-hero-info h1 {
        font-size: 24px;
    }
    
    .app-params {
        grid-template-columns: 1fr;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .category-title {
        font-size: 20px;
    }
    
    .apps-grid {
        margin: 0 -5px;
        gap: 10px;
    }
    
    .apps-grid > * {
        width: calc((100% - 20px) / 2);
        margin: 0 5px;
    }
    
    .app-card {
        padding: 5px;
    }
}

@media (min-width: 1200px) {
    .apps-grid {
        gap: 20px;
    }
    .apps-grid > * {
        width: calc((100% - 100px) / 6);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .apps-grid {
        gap: 18px;
    }
    .apps-grid > * {
        width: calc((100% - 90px) / 5);
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .apps-grid {
        gap: 16px;
    }
    .apps-grid > * {
        width: calc((100% - 64px) / 4);
    }
}

/* ==========================================================================
   ТОП ПРИЛОЖЕНИЙ - ПРЕСЕТЫ СТИЛЕЙ
   ========================================================================== */

.top-apps-section {
    margin: 40px 0;
    padding: 30px;
    border-radius: 12px;
    position: relative;
}

.top-apps-header {
    margin-bottom: 30px;
    text-align: center;
}

.top-apps-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.top-apps-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 5), 1fr);
    gap: 20px;
    margin-top: 20px;
}

.top-apps-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* Премиум золотой */
.top-apps-section.premium-gold {
    background: linear-gradient(135deg, #fff9e6 0%, #fff4d6 100%);
    border: 3px solid #FFD700;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3), 0 0 0 1px rgba(255, 215, 0, 0.1);
}

.top-apps-section.premium-gold .top-apps-title {
    color: #B8860B;
    text-shadow: 0 2px 4px rgba(184, 134, 11, 0.2);
}

.top-apps-section.premium-gold .top-apps-title::before {
    content: '👑 ';
}

/* Премиум синий */
.top-apps-section.premium-blue {
    background: linear-gradient(135deg, #e6f3ff 0%, #d6ebff 100%);
    border: 3px solid #4A90E2;
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.3), 0 0 0 1px rgba(74, 144, 226, 0.1);
}

.top-apps-section.premium-blue .top-apps-title {
    color: #2C5AA0;
    text-shadow: 0 2px 4px rgba(44, 90, 160, 0.2);
}

.top-apps-section.premium-blue .top-apps-title::before {
    content: '⭐ ';
}

/* Премиум фиолетовый */
.top-apps-section.premium-purple {
    background: linear-gradient(135deg, #f0e6ff 0%, #e6d6ff 100%);
    border: 3px solid #9B59B6;
    box-shadow: 0 8px 24px rgba(155, 89, 182, 0.3), 0 0 0 1px rgba(155, 89, 182, 0.1);
}

.top-apps-section.premium-purple .top-apps-title {
    color: #6B3483;
    text-shadow: 0 2px 4px rgba(107, 52, 131, 0.2);
}

.top-apps-section.premium-purple .top-apps-title::before {
    content: '💎 ';
}

/* Адаптивность для топ приложений */
@media (max-width: 768px) {
    .top-apps-section {
        padding: 20px 15px;
    }
    
    .top-apps-title {
        font-size: 24px;
    }
    
    .top-apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .top-apps-grid {
        grid-template-columns: 1fr;
    }
}

/* Анимация при наведении на карточки в топ приложениях */
.top-apps-section .app-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.top-apps-section .app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

