/* ========================================
   リセット & ベーススタイル
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* カラーパレット - 情熱的で洗練された色合い */
    --primary-color: #e91e63;
    --primary-dark: #c2185b;
    --secondary-color: #ff6b9d;
    --accent-color: #ffd700;
    --dark-bg: #1a1a2e;
    --darker-bg: #0f0f1e;
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --overlay-dark: rgba(0, 0, 0, 0.8);
    --shelf-color: #3a2f28;
    --shelf-shadow: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* ========================================
   トップバー（ブログに戻るボタン）
   ======================================== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 107, 157, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.blog-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 107, 157, 0.3);
    transition: all 0.3s ease;
}

.blog-back-btn:hover {
    background: rgba(255, 107, 157, 0.2);
    border-color: var(--secondary-color);
    transform: translateX(-5px);
}

.blog-back-btn i {
    font-size: 0.9rem;
}

/* ========================================
   ヘッダーセクション
   ======================================== */
.header {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    overflow: hidden;
    padding-top: 60px; /* トップバーの高さ分 */
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') bottom repeat-x;
    animation: wave 15s linear infinite;
}

@keyframes wave {
    0% { background-position-x: 0; }
    100% { background-position-x: 1440px; }
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 107, 157, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(102, 126, 234, 0.3) 0%, transparent 50%);
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: fadeInUp 1s ease;
}

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

.header-title {
    margin-bottom: 20px;
}

.title-main {
    display: block;
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.title-sub {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    font-weight: 700;
    letter-spacing: 3px;
    opacity: 0.9;
    text-transform: uppercase;
}

.header-description {
    font-size: clamp(1rem, 4vw, 1.3rem);
    line-height: 1.8;
    margin: 30px auto;
    max-width: 600px;
    opacity: 0.95;
    font-weight: 500;
}

.sp-only {
    display: none;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: 20px;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    font-size: 2rem;
    opacity: 0.7;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ========================================
   フィルターセクション
   ======================================== */
.filter-section {
    position: sticky;
    top: 50px; /* トップバーの下に配置 */
    background: var(--darker-bg);
    padding: 20px 0;
    z-index: 100;
    border-bottom: 2px solid rgba(255, 107, 157, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: var(--text-light);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Sans JP', sans-serif;
}

.filter-btn:hover {
    background: rgba(255, 107, 157, 0.2);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

/* ========================================
   本棚セクション
   ======================================== */
.bookshelf-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 900;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-title i {
    color: var(--secondary-color);
}

.section-subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--text-gray);
    font-weight: 500;
}

/* 本棚のスタイル */
.bookshelf {
    position: relative;
    margin-bottom: 60px;
    padding-top: 20px;
}

.shelf-background {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(180deg, var(--shelf-color) 0%, #2a1f18 100%);
    box-shadow: 
        0 4px 10px var(--shelf-shadow),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.shelf-background::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
}

.books-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px 40px;
    min-height: 400px; /* フィルター時の高さ変動を防ぐ */
}

/* 本のアイテム */
.book-item {
    transition: all 0.3s ease;
}

.book-item.hidden {
    display: none;
}

.book-spine {
    position: relative;
    height: 100%;
    perspective: 1000px;
}

.book-cover {
    position: relative;
    aspect-ratio: 7/10;
    border-radius: 8px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.4s ease;
    overflow: hidden;
}

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

.book-item:hover .book-cover {
    transform: translateY(-10px) rotateY(5deg);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(255, 107, 157, 0.3);
}

.book-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: var(--dark-bg);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 900;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.book-badge.hot {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: var(--text-light);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.book-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.8) 100%);
}

.book-title {
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 900;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.book-description {
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    line-height: 1.5;
    opacity: 0.95;
    margin: 10px 0;
    flex-grow: 1;
}

.book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-old {
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
    font-weight: 600;
}

.price {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 700;
}

.rating i {
    color: var(--accent-color);
    font-size: 0.8rem;
}

.book-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.book-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.5);
}

/* ========================================
   特徴セクション
   ======================================== */
.features-section {
    padding: 80px 0;
    background: var(--darker-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 107, 157, 0.2);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 40px rgba(255, 107, 157, 0.2);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.feature-title {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 15px;
}

.feature-text {
    color: var(--text-gray);
    line-height: 1.8;
}

/* ========================================
   CTAセクション
   ======================================== */
.cta-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(0, 0, 0, 0.2) 0%, transparent 50%);
}

.cta-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.cta-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cta-text {
    font-size: clamp(1rem, 3vw, 1.3rem);
    line-height: 1.8;
    margin-bottom: 40px;
    opacity: 0.95;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--text-light);
    color: var(--primary-color);
    padding: 20px 50px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 900;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* ========================================
   フッター
   ======================================== */
.footer {
    background: var(--darker-bg);
    padding: 60px 0 30px;
    border-top: 2px solid rgba(255, 107, 157, 0.3);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.footer-brand p {
    color: var(--text-gray);
}

.footer-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* ========================================
   レスポンシブデザイン（スマホファースト）
   ======================================== */

/* タブレット以下 */
@media (max-width: 768px) {
    .sp-only {
        display: inline;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .blog-back-btn {
        font-size: 0.85rem;
        padding: 6px 16px;
    }
    
    .blog-back-btn span {
        display: none;
    }
    
    .blog-back-btn::after {
        content: 'ブログ';
        margin-left: 4px;
    }
    
    .filter-section {
        top: 46px; /* スマホ用のトップバーの高さ */
    }
    
    .header {
        min-height: 100svh; /* モバイルブラウザ対応 */
        padding: 60px 0 40px;
    }
    
    .header-description {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .filter-buttons {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .bookshelf-section {
        padding: 50px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .bookshelf {
        margin-bottom: 50px;
    }
    
    .books-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 10px 30px;
    }
    
    .book-overlay {
        padding: 15px;
    }
    
    .book-description {
        font-size: 0.75rem;
    }
    
    .book-link {
        padding: 12px;
        font-size: 0.85rem;
        margin-top: 10px;
    }
    
    .features-section {
        padding: 50px 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .cta-section {
        padding: 60px 0;
    }
    
    .cta-button {
        padding: 16px 40px;
        font-size: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

/* 小型スマホ */
@media (max-width: 480px) {
    .books-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .book-cover {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .filter-btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 140px;
        justify-content: center;
    }
}

/* 横向きスマホ対応 */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        min-height: auto;
        padding: 40px 0;
    }
    
    .books-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 大型デスクトップ */
@media (min-width: 1400px) {
    .books-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}
