/* 共通スタイル */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap');

:root {
    --font-family: 'Noto Sans JP', sans-serif;
    --primary-color: #1D2082;
    --primary-light: #3D4DB5;
    --primary-dark: #0F1459;
    --secondary-color: #F1F2F9;
    --accent-color: #4A90E2;
    --text-color: #2D3748;
    --text-light: #718096;
    --bg-color: #FFFFFF;
    --bg-light: #F7F9FC;
    --border-color: #CBD5E0;
    --success-color: #38A169;
    --error-color: #E53E3E;
    --warning-color: #D69E2E;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(29, 32, 130, 0.15);
    --shadow-light: 0 2px 8px rgba(29, 32, 130, 0.08);
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-base: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-xxl: 24px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    --line-height: 1.6;
    --container-padding: 20px;
    --nav-bar-height: 80px;
    --header-height: 60px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    line-height: var(--line-height);
    color: var(--text-color);
}

*, *::before, *::after {
    font-family: var(--font-family);
}

.container {
    max-width: 375px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
}

.screen {
    display: none;
    padding: 0;
    min-height: calc(100vh - 60px);
    width: 100%;
}

.screen.active {
    display: block;
    width: 100%;
}

.nav-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 375px;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    z-index: 1000;
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    flex: 1;
    font-size: 12px;
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
}

.nav-btn img {
    width: 32px;
    height: 32px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.nav-btn.active img {
    opacity: 1;
}

.nav-btn.active {
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-color);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: var(--font-family);
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    font-family: var(--font-family);
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: var(--font-weight-medium);
}

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

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(29, 32, 130, 0.08);
}

.magazine-card {
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.magazine-cover {
    width: 80px;
    height: 100px;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border: 2px solid rgba(29, 32, 130, 0.12);
}

.magazine-info h3 {
    color: var(--text-color);
    margin-bottom: 5px;
}

.magazine-info p {
    color: var(--text-light);
    font-size: 14px;
}

.price {
    color: var(--accent-color);
    font-weight: bold;
    margin-top: 5px;
}



/* 課金確認モーダル */
.purchase-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.purchase-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 350px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.modal-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.modal-body {
    padding: 25px;
}

.modal-magazine {
    text-align: center;
    margin-bottom: 25px;
}

.modal-magazine-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.modal-magazine-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.modal-magazine-price {
    font-size: 24px;
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.modal-magazine-description {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.4;
}

.modal-features {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 20px 0;
    border: 1px solid rgba(29, 32, 130, 0.08);
}

.modal-features h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--text-color);
}

.modal-features ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-light);
    font-size: 14px;
}

.modal-features li {
    margin-bottom: 5px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-primary {
    background: var(--primary-color);
    color: white;
}

.modal-btn-primary:hover {
    background: var(--primary-dark);
}

.modal-btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.modal-btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.modal-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    margin: 15px 0;
    font-size: 13px;
    color: #856404;
    text-align: center;
}

/* カテゴリタブのスタイル */
.category-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    margin: 15px 20px 0 20px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 15px 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
    color: #495057;
}

/* 雑誌リストのコンテナ */
#magazine-list {
    padding: 20px 20px 100px 20px;
}

/* バナー広告 */
.banner-ad {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 375px;
    max-width: 100%;
    padding: 0 15px;
    z-index: 50;
    box-sizing: border-box;
}

.ad-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    padding: 12px 15px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ad-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.2);
}

.ad-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.ad-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(255,255,255,0.9);
    color: #666;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.ad-main {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.ad-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.ad-text {
    flex: 1;
}

.ad-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
    line-height: 1.3;
}

.ad-subtitle {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.2;
}

.ad-arrow {
    font-size: 18px;
    opacity: 0.8;
    flex-shrink: 0;
}

/* レスポンシブ対応 */
@media (max-width: 375px) {
    .banner-ad {
        width: 100%;
        padding: 0 10px;
    }
    
    .ad-content {
        padding: 10px 12px;
    }
    
    .ad-title {
        font-size: 13px;
    }
    
    .ad-subtitle {
        font-size: 11px;
    }
    
    .ad-icon {
        font-size: 22px;
    }
}