/* リセットとベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #030303;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    background: #ffffff;
}

/* ヘッダー */
.header {
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    height: 56px;
}

.menu-button,
.search-button {
    background: none;
    border: none;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: #cc0000;
}

/* 検索バー */
.search-bar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 16px;
    background: #ffffff;
}

.voice-search {
    background: none;
    border: none;
    font-size: 20px;
    padding: 8px;
    margin-left: 8px;
}

/* 言語切り替えボタン */
.language-toggle {
    display: flex;
    justify-content: flex-end;
    padding: 8px 16px;
}

.lang-button {
    background: #065fd4;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* フィルタータブ */
.filter-tabs {
    display: flex;
    padding: 8px 16px;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #e5e5e5;
}

.filter-tab {
    background: #f2f2f2;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-tab.active {
    background: #030303;
    color: white;
}

/* 検索結果 */
.search-results {
    padding: 8px 0;
}

/* メディアアイテム（動画） */
.media-item {
    padding: 8px 16px;
    transition: opacity 0.3s, transform 0.3s;
}

.media-item-container {
    display: block;
}

.video-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 アスペクト比 */
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 動画情報 */
.media-item-info {
    padding: 4px 0;
}

.media-item-headline {
    margin-bottom: 4px;
}

.media-item-headline a {
    text-decoration: none;
    color: inherit;
}

.media-item-headline span {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* メタデータ */
.media-item-metadata {
    font-size: 13px;
    color: #606060;
}

.media-item-byline {
    margin-bottom: 2px;
}

.channel-name {
    text-decoration: none;
    color: #606060;
    font-weight: 400;
}

.metadata-line {
    font-size: 12px;
    color: #606060;
}

/* ブロックされた動画の非表示スタイル */
.media-item.blocked {
    display: none !important;
}

/* レスポンシブ調整 */
@media (max-width: 390px) {
    .header-content {
        padding: 8px 12px;
    }
    
    .search-bar {
        padding: 8px 12px;
    }
    
    .media-item {
        padding: 8px 12px;
    }
}

/* ダークモード対応（システム設定に従う） */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f0f0f;
        color: #f1f1f1;
    }
    
    .app-container {
        background: #0f0f0f;
    }
    
    .header {
        background: #0f0f0f;
        border-bottom-color: #303030;
    }
    
    .search-bar {
        background: #212121;
        border-bottom-color: #303030;
    }
    
    .search-input {
        background: #121212;
        border-color: #303030;
        color: #f1f1f1;
    }
    
    .filter-tabs {
        border-bottom-color: #303030;
    }
    
    .filter-tab {
        background: #272727;
        color: #f1f1f1;
    }
    
    .filter-tab.active {
        background: #f1f1f1;
        color: #0f0f0f;
    }
    
    .channel-name,
    .metadata-line {
        color: #aaaaaa;
    }
}