/* ========================================
   GameDeals Hunter - Styles
   ダークテーマ・ゲーマー向けデザイン
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #222233;
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-glow: rgba(124, 58, 237, 0.4);
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2d2d3d;
    --gradient-1: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --gradient-2: linear-gradient(135deg, #0ea5e9 0%, #7c3aed 100%);
    --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

/* ========================================
   広告コンテナ
   ======================================== */
.ad-container {
    width: 100%;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.ad-container.ad-bottom {
    border-top: 1px solid var(--border-color);
    border-bottom: none;
}

.ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

.ad-inline {
    margin: 20px 0;
    background: transparent;
    border: none;
}

.ad-inline .ad-placeholder {
    max-width: 100%;
    height: 120px;
}

/* ========================================
   ヘッダー
   ======================================== */
.header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 50%);
    opacity: 0.3;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 48px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--accent-glow);
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 言語切り替え */
.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.lang-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

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

.lang-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ========================================
   メインコンテナ
   ======================================== */
.main-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: 24px;
}

/* ========================================
   サイドバー
   ======================================== */
.sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.filter-section,
.stats-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.filter-section h3,
.stats-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:hover,
.filter-group select:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.btn-reset {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

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

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========================================
   コンテンツエリア
   ======================================== */
.content {
    min-width: 0;
}

/* タブ */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.tab.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

.badge {
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.tab.active .badge {
    background: rgba(255, 255, 255, 0.3);
}

/* 検索バー */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.search-bar input {
    flex: 1;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar button {
    padding: 14px 20px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* ローディング */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: var(--text-secondary);
}

/* エラーメッセージ */
.error-message {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--accent-red);
}

.error-message p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.btn-retry {
    padding: 12px 24px;
    background: var(--accent-red);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-retry:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* ========================================
   ゲームグリッド
   ======================================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ゲームカード */
.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.game-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.game-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-free {
    background: var(--accent-green);
    color: white;
}

.badge-loot {
    background: var(--accent-yellow);
    color: #000;
}

.badge-beta {
    background: var(--accent-primary);
    color: white;
}

.game-card-favorite {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card-favorite:hover,
.game-card-favorite.active {
    background: var(--accent-red);
    color: white;
}

.game-card-content {
    padding: 16px;
}

.game-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.meta-tag {
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

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

.value-label {
    font-size: 12px;
    color: var(--text-muted);
}

.value-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-green);
}

.game-card-action {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
}

.game-card-action:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* もっと見るボタン */
.btn-load-more {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 30px auto;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-load-more:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

/* ========================================
   フッター
   ======================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    text-align: center;
}

.footer p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========================================
   モーダル
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.modal-body {
    padding: 24px;
}

.modal-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

.modal-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.modal-info-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.modal-info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.modal-info-value {
    font-size: 14px;
    font-weight: 500;
}

.modal-action {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
}

.modal-action:hover {
    opacity: 0.9;
    transform: scale(1.01);
    box-shadow: var(--shadow-glow);
}

/* ========================================
   空の状態
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .filter-section,
    .stats-section {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 30px 16px;
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .logo-icon {
        font-size: 36px;
    }

    .main-container {
        padding: 12px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .tab {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 13px;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-info {
        grid-template-columns: 1fr;
    }

    .ad-placeholder {
        height: 60px;
        font-size: 12px;
    }
}