/* ベースリセット */
body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    background-color: #f4f6f9;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ヘッダー */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}
.main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
.main-menu a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
}
.main-menu a:hover { color: #007bff; }
.menu-toggle { display: none; }

/* スマホメニュー */
@media (max-width: 768px) {
    .menu-toggle { display: block; background:none; border:none; cursor:pointer; }
    .menu-toggle span { display:block; width:25px; height:3px; background:#333; margin:5px 0; }
    .main-menu { display: none; position:absolute; top:100%; left:0; width:100%; background:#fff; border-top:1px solid #eee; }
    .main-menu.active { display:block; }
    .main-menu ul { flex-direction:column; padding:20px; align-items:center; }
}

/* タイトルエリア */
.page-header {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    margin-bottom: 20px;
}
.page-header h1 { margin: 0 0 10px 0; color: #007bff; }
.page-header p { color: #666; margin: 0; line-height: 1.6; }

/* コントロールバー（フィルタ・ソート） */
.control-bar {
    max-width: 1000px;
    margin: 0 auto 30px;
    padding: 0 20px;
}
.control-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.filter-btn {
    background: #eef2f7;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}
.filter-btn.active, .filter-btn:hover { background: #007bff; color: #fff; }
#sort-select { padding: 8px; border-radius: 4px; border: 1px solid #ddd; }

/* アプリ一覧グリッド */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* カードデザイン */
.app-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}
.app-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

/* 画像カルーセル */
.carousel {
    position: relative;
    width: 100%;
    height: 220px;
    background: #eee;
    overflow: hidden;
}
.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-out;
}
.carousel-img {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 2;
}
.carousel-btn:hover { background: rgba(0,0,0,0.8); }
.carousel-btn.prev { left: 0; border-radius: 0 5px 5px 0; }
.carousel-btn.next { right: 0; border-radius: 5px 0 0 5px; }

/* コンテンツ部分 */
.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.app-title { margin: 0 0 10px; font-size: 1.25rem; color: #2c3e50; }
.app-desc { font-size: 0.9rem; color: #666; line-height: 1.5; margin-bottom: 15px; flex-grow: 1; }

/* 日付表示 */
.date-info {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 8px;
}
.date-badge { display: inline-flex; align-items: center; }
.date-badge::before { content: ''; display: inline-block; width: 6px; height: 6px; background: #ddd; border-radius: 50%; margin-right: 5px; }
.date-badge.update::before { background: #28a745; }

/* アクションボタン */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.2s;
    text-align: center;
    box-sizing: border-box;
}

/* 体験ボタン */
.btn-primary { 
    flex: 2; /* 幅を広めに */
    background: #007bff; 
    color: #fff; 
    border: 1px solid #007bff;
}
.btn-primary:hover { background: #0056b3; }

/* GitHubボタン（確実に黒くする） */
.btn-github { 
    flex: 1; /* 幅を狭めに */
    background: #24292e; 
    color: #fff; 
    border: 1px solid #24292e;
}
.btn-github:hover { 
    background: #000000; 
    border-color: #000000;
}

/* 無効ボタン */
.btn-disabled { 
    flex: 2; 
    background: #e9ecef; 
    color: #999; 
    cursor: not-allowed; 
    border: 1px solid #e9ecef;
}

/* フッター */
footer { margin-top: auto; background: #fff; border-top: 1px solid #eee; padding: 40px 20px; text-align: center; }
.repo-link {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 30px;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    margin-bottom: 15px;
}
.repo-link:hover { border-color: #007bff; color: #007bff; background: #f8f9fa; }
.copyright { font-size: 0.85rem; color: #888; }
.copyright a { color: #888; }

/* モーダル */
.modal { display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); justify-content: center; align-items: center; }
.modal-content { max-width: 90%; max-height: 85vh; object-fit: contain; }
.close-button { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 40px; cursor: pointer; }
.modal-nav { position: absolute; background: rgba(255,255,255,0.1); color: #fff; border: none; padding: 15px; font-size: 2rem; cursor: pointer; }
.modal-nav:hover { background: rgba(255,255,255,0.3); }
.modal-nav.prev { left: 20px; }
.modal-nav.next { right: 20px; }