body {
    font-family: sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0; /* bodyのpaddingは削除 */
}

main {
    padding: 20px; /* main要素にpaddingを移動 */
}

.container {
    max-width: 960px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    color: #333;
}

a {
    color: #007bff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* 動画一覧 */
.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.video-item a {
    display: block;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    color: #333;
    transition: box-shadow 0.2s;
}
.video-item a:hover {
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.video-item h2 {
    font-size: 1em;
    padding: 10px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #fff;
}
.thumbnail, .thumbnail-img {
    width: 100%;
    height: 124px;
    background-color: #e9e9e9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.thumbnail-img {
    object-fit: cover;
}
.thumbnail-niconico {
    font-size: 4em;
    font-weight: bold;
    color: #a0a0a0;
    background-color: #333;
}
.thumbnail-direct {
    font-size: 4em;
    color: #aaa;
}


/* 動画視聴ページ */
.video-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9のアスペクト比 */
    background-color: #000;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 20px;
}
.video-player video,
.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

/* フォーム */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* --- ここからボタンのスタイルを修正 --- */

/* ボタン共通スタイル */
button {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* フォームの標準ボタン (登録、ログインなど) */
form button,
#favorite-user-btn {
    background-color: #007bff;
    color: #ffffff; /* 白文字 */
    border-color: #007bff;
}
form button:hover,
#favorite-user-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}
#favorite-user-btn.active {
    background-color: #28a745; /* 緑色 */
    border-color: #28a745;
}


/* 動画アクションボタン (いいね、マイリスト) */
.video-actions {
    margin: 15px 0;
    display: flex;
    gap: 10px;
}
.video-actions button {
    background-color: #f0f0f0;
    color: #333333; /* ★★★ 濃いグレーの文字色を明示的に指定 ★★★ */
    border-color: #ccc;
}
.video-actions button:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}
/* いいね、マイリストのアクティブ状態 */
.video-actions button.active {
    background-color: #fce4e4; /* 明るいピンクの背景 */
    color: #c9302c; /* ★★★ 濃い赤色の文字を指定して視認性を確保 ★★★ */
    border-color: #f5c6cb;
}


/* 削除ボタン */
.delete-section {
    margin-top: 30px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
}
.delete-btn {
    background-color: #d9534f;
    color: #ffffff; /* 白文字 */
    border-color: #d9534f;
}
.delete-btn:hover {
    background-color: #c9302c;
    border-color: #c9302c;
}

/* --- ここまでがボタンの修正 --- */

/* ヘッダー */
.site-header {
    background-color: #333;
    color: #fff;
    padding: 10px 0;
    margin-bottom: 20px;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* .containerと同じ幅と中央寄せを適用 */
    max-width: 960px;
    margin: 0 auto;
    padding: 0 30px;
}
.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
}
.logo:hover { text-decoration: none; }
.site-header nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 5px;
}
.site-header nav ul li a {
    color: #fff;
    padding: 8px 12px;
    display: block;
    border-radius: 4px;
}
.site-header nav ul li a:hover {
    background-color: #555;
    text-decoration: none;
}

/* フォーム共通 */
.form-centered {
    max-width: 400px;
    margin: 20px auto;
}
.error { color: #d9534f; font-weight: bold; }
.message { color: #28a745; font-weight: bold; }


/* 動画メタ情報 (投稿者など) */
.video-meta {
    margin-top: 5px;
    margin-bottom: 15px;
    color: #555;
    font-size: 0.9em;
}
.video-meta span {
    margin-left: 15px;
}

/* コメント */
.comment-section { margin-top: 30px; }
.comment-section textarea {
    width: 100%;
    height: 80px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 10px;
}
.comment-list { margin-top: 20px; }
.comment-item {
    border-top: 1px solid #eee;
    padding: 15px 0;
}
.comment-body { margin: 0 0 5px; }
.comment-meta { font-size: 0.8em; color: #777; }