/* ==========================================================================
   AKeys Easy Theme - Main Stylesheet
   Поддержка мульти-консольных тем (PlayStation, Xbox, Nintendo, Retro 8/16-bit)
   ========================================================================== */

/* 1. ПЕРЕМЕННЫЕ И ТЕМЫ КОНСОЛЕЙ */

/* Тема по умолчанию: PlayStation Dark */
:root,
body[data-theme="ps-dark"] {
    --bg-main: #0b0f19;
    --bg-surface: #151d30;
    --bg-card: #1c2742;
    --border-color: #2b395e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --brand-primary: #0070d1;
    --brand-hover: #0056a3;
    --brand-glow: rgba(0, 112, 209, 0.4);
    --accent-color: #38bdf8;
    --badge-bg: rgba(56, 189, 248, 0.15);
    --badge-text: #38bdf8;
    --font-heading: 'Inter', sans-serif;
    --border-radius: 12px;
}

/* PlayStation Light */
body[data-theme="ps-light"] {
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --border-color: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --brand-primary: #00439c;
    --brand-hover: #002f6c;
    --brand-glow: rgba(0, 67, 156, 0.2);
    --accent-color: #0284c7;
    --badge-bg: #e0f2fe;
    --badge-text: #0369a1;
    --font-heading: 'Inter', sans-serif;
    --border-radius: 12px;
}

/* Xbox Dark */
body[data-theme="xbox-dark"] {
    --bg-main: #0c120c;
    --bg-surface: #141f14;
    --bg-card: #1c2b1c;
    --border-color: #2b452b;
    --text-primary: #f0fdf4;
    --text-secondary: #86efac;
    --brand-primary: #107c10;
    --brand-hover: #0b580b;
    --brand-glow: rgba(16, 124, 16, 0.4);
    --accent-color: #22c55e;
    --badge-bg: rgba(34, 197, 94, 0.2);
    --badge-text: #4ade80;
    --font-heading: 'Inter', sans-serif;
    --border-radius: 8px;
}

/* Xbox Light */
body[data-theme="xbox-light"] {
    --bg-main: #f0fdf4;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --border-color: #bbf7d0;
    --text-primary: #14532d;
    --text-secondary: #166534;
    --brand-primary: #107c10;
    --brand-hover: #0e630e;
    --brand-glow: rgba(16, 124, 16, 0.2);
    --accent-color: #15803d;
    --badge-bg: #dcfce7;
    --badge-text: #166534;
    --font-heading: 'Inter', sans-serif;
    --border-radius: 8px;
}

/* Nintendo Switch Dark */
body[data-theme="nintendo-dark"] {
    --bg-main: #141416;
    --bg-surface: #1f1f23;
    --bg-card: #28282e;
    --border-color: #3f3f46;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --brand-primary: #e60012;
    --brand-hover: #b8000e;
    --brand-glow: rgba(230, 0, 18, 0.4);
    --accent-color: #00c3e3; /* Neon Blue Joycon */
    --badge-bg: rgba(230, 0, 18, 0.2);
    --badge-text: #ff4d5a;
    --font-heading: 'Inter', sans-serif;
    --border-radius: 16px;
}

/* Nintendo Switch Light */
body[data-theme="nintendo-light"] {
    --bg-main: #fbfbfb;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e4e4e7;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --brand-primary: #e60012;
    --brand-hover: #c4000f;
    --brand-glow: rgba(230, 0, 18, 0.2);
    --accent-color: #0099b8;
    --badge-bg: #fee2e2;
    --badge-text: #991b1b;
    --font-heading: 'Inter', sans-serif;
    --border-radius: 16px;
}

/* Retro 8-bit / 16-bit (Dendy & Sega Nostalgia) */
body[data-theme="retro"] {
    --bg-main: #201a35;
    --bg-surface: #2c224a;
    --bg-card: #3a2e63;
    --border-color: #ffcc00;
    --text-primary: #ffffff;
    --text-secondary: #fbc531;
    --brand-primary: #e84118;
    --brand-hover: #c23616;
    --brand-glow: rgba(255, 204, 0, 0.5);
    --accent-color: #00d2d3;
    --badge-bg: #44bd32;
    --badge-text: #ffffff;
    --font-heading: 'Press Start 2P', monospace;
    --border-radius: 0px; /* Пиксельная угловатость */
}

/* 2. БАЗОВЫЕ СТИЛИ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

/* Шрифты для ретро темы */
body[data-theme="retro"] h1,
body[data-theme="retro"] h2,
body[data-theme="retro"] h3,
body[data-theme="retro"] .btn {
    font-family: var(--font-heading);
    letter-spacing: -1px;
}

/* 3. ШАПКА САЙТА (HEADER) */
.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
    backdrop-filter: blur(10px);
}

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

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 22px;
}

.site-logo .logo-icon {
    font-size: 26px;
}

.site-logo span span {
    color: var(--accent-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Селектор консольных тем */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: var(--border-radius);
}

.theme-selector label {
    font-size: 13px;
    color: var(--text-secondary);
    display: none;
}
@media (min-width: 640px) {
    .theme-selector label { display: inline; }
}

.theme-dropdown {
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.theme-dropdown option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* 4. КНОПКИ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--brand-glow);
}

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

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* 5. ПОШАГОВЫЙ ПОДБОР ДЛЯ НОВИЧКОВ (HERO WIDGET) */
.hero-finder-section {
    padding: 40px 0 30px;
}

.hero-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 25px;
}

.steps-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.step-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: left;
    transition: all 0.2s ease;
}

.step-card.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--brand-glow);
}

.step-num {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.step-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.choice-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice-btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.choice-btn.selected {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

/* 6. СЕТКА И КАРТОЧКА ИГРЫ */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.3);
    border-color: var(--accent-color);
}

.game-poster-link {
    position: relative;
    display: block;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #000;
}

.game-poster-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card:hover .game-poster-link img {
    transform: scale(1.05);
}

.game-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    background: var(--badge-bg);
    color: var(--badge-text);
    backdrop-filter: blur(8px);
}

.badge-ru { background: #dcfce7; color: #15803d; }
.badge-hit { background: #fef08a; color: #854d0e; }

.game-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.game-platforms {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.game-card-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.game-card-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.game-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.game-card-price small {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}

.game-card-price strong {
    font-size: 18px;
    color: var(--accent-color);
}

/* 7. СТРАНИЦА ИГРЫ (SINGLE-GAME.PHP) */
.single-game-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 40px;
    padding: 40px 0;
}
@media (max-width: 860px) {
    .single-game-layout { grid-template-columns: 1fr; }
}

.game-media img {
    width: 100%;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Табы сделки */
.deal-tabs {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 6px;
    margin-bottom: 25px;
    gap: 8px;
}

.deal-tab-btn {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.deal-tab-btn.active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--brand-glow);
}

/* Карточки слотов Эконом / VIP */
.slot-tariffs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
@media (max-width: 640px) {
    .slot-tariffs-grid { grid-template-columns: 1fr; }
}

.tariff-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tariff-card.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--brand-glow);
}

.tariff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tariff-title {
    font-size: 18px;
    font-weight: 700;
}

.tariff-badge {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
}
.badge-econom { background: #e0f2fe; color: #0284c7; }
.badge-vip { background: #fef3c7; color: #b45309; }

.tariff-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    min-height: 40px;
}

.tariff-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-color);
}

/* 8. РАЗДЕЛ "КАК ЗАПУСТИТЬ ИГРУ" (3 ПРОСТЫХ ШАГА) */
.how-it-works {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 40px 0;
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.how-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--border-radius);
}

.how-step-num {
    font-size: 28px;
    font-weight: 900;
    color: var(--accent-color);
    margin-bottom: 8px;
}

/* 9. МОДАЛЬНОЕ ОКНО БЫСТРОГО ЗАКАЗА */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(6px);
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-width: 520px;
    width: 100%;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.messenger-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0 20px;
}

.messenger-btn {
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.messenger-btn.selected {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: #fff;
}

/* Футер */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 60px;
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}
