/* public/style.css - 完全版 (修正済み) */

/* --- 基本変数定義 (Netflixカラー) --- */
:root {
    --bg-color: #141414;
    --card-bg: #2f2f2f;
    --primary-red: #E50914;
    --text-color: #ffffff;
    --text-sub: #b3b3b3;
    --header-bg: rgba(0,0,0,0.9);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* --- ヘッダー (PC/共通) --- */
.netflix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 4%;
    background: linear-gradient(to bottom, var(--header-bg) 10%, transparent);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    color: var(--primary-red);
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* --- プロフィールメニュー --- */
.profile-menu {
    position: relative;
    /* margin-left: 20px; */ /* 必要であれば維持 */
    cursor: pointer;
    display: flex;
    align-items: center;
    padding-top: 5px;
    padding-bottom: 50px;
}
.profile-menu img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: block;
}

.dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 37px; /* 画像の高さ(32px) + profile-menuのpadding-bottom(5px) = 37px を目安に調整 */
    background-color: rgba(0,0,0,0.95);
    border: 1px solid #333;
    width: 200px;
    padding: 10px;
    font-size: 13px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 101;
}

.profile-menu:hover .dropdown {
    display: block;
}
.dropdown .email {
    display: block;
    padding: 5px;
    color: #ccc;
    font-size: 11px;
    text-overflow: ellipsis;
    overflow: hidden;
}

.dropdown hr {
    border-color: #333;
}

.dropdown-item {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 10px 5px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

.dropdown-item:hover {
    text-decoration: underline;
    color: var(--primary-red);
}

.dropdown-item.warn {
    color: var(--primary-red);
    font-weight: bold;
}



/* --- メインコンテンツ --- */
main {
    padding: 0 4%; /* 上下のパディングを削除して余白を詰める */
    min-height: 80vh;
}

.hero {
    margin-bottom: 10px; /* 下の余白を大幅に削減 */
    text-align: center;
    padding: 60px 0 20px 0; /* 上は広め、下は狭めに */
    animation: fadeIn 1s ease;
}

.hero h1 {
    font-size: 3rem; /* タイトルを大きく */
    font-weight: 800;
    margin-bottom: 10px;
}

.hero p {
    color: var(--text-sub);
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* --- ヒーローエリアの入力フォーム (Netflix風・決定版) --- */
.hero-form {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.hero-input-group {
    display: flex; /* 横並びにする */
    justify-content: center;
    height: 60px; /* 高さを大きくしてリッチに */
    width: 100%;
}

.hero-input {
    flex: 1; /* 横幅いっぱいに広げる */
    padding: 0 20px;
    font-size: 1.2rem;
    border: 1px solid #333;
    border-right: none; /* ボタンとの境界線を消す */
    border-radius: 4px 0 0 4px; /* 左側だけ丸く */
    background: rgba(0, 0, 0, 0.7); /* 半透明の黒 */
    color: white;
    outline: none;
    min-width: 0; /* フレックスボックスでの崩れ防止 */
}

.hero-input:focus {
    background: rgba(0, 0, 0, 0.9);
    border-color: #666;
}

.hero-input::placeholder {
    color: #8c8c8c;
}

.hero-btn {
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 0 30px;
    font-size: 1.5rem; /* 文字を大きく */
    font-weight: bold;
    border-radius: 0 4px 4px 0; /* 右側だけ丸く */
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* テキストの折り返し防止 */
}

.hero-btn:hover {
    background-color: #f40612;
}

.hero-btn i {
    margin-left: 8px;
    font-size: 1rem;
}

/* --- スマホ対応 (入力フォーム) --- */
@media (max-width: 768px) {
    .netflix-header {
        padding: 10px 4%;
    }
    .hero {
        padding: 40px 0 10px 0;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero-input-group {
        flex-direction: column; /* スマホでは縦並び */
        height: auto;
        gap: 10px;
        padding: 0 10px; /* 横の余白 */
    }
    .hero-input, .hero-btn {
        width: 100%;
        border-radius: 4px; /* 角を全て丸く */
        height: 50px;
        border: 1px solid #333; /* ボーダーを復活 */
        box-sizing: border-box;
    }
    .ad-container {
        margin: 15px 5px;
        padding: 0;
    }
}

/* --- リスト・グリッド --- */
.category-title {
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #e5e5e5;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* カードスタイル */
.word-card {
    background-color: var(--card-bg);
    border-radius: 4px;
    padding: 20px;
    position: relative;
    transition: transform 0.2s, background-color 0.2s;
    height: 160px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.word-card:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    background-color: #3a3a3a;
}

.card-content {
    flex: 1;
    overflow: hidden;
}

.card-content h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-content .meaning {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-top: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content .memo {
    color: #666;
    font-size: 0.8rem;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #444;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.word-card:hover .card-overlay { opacity: 1; }

.card-overlay {
    opacity: 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    padding: 10px;
    display: flex;
    justify-content: center;
    transition: opacity 0.2s;
}

.card-overlay button {
    background: white;
    color: black;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    margin: 0 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.card-overlay button:hover {
    background: var(--primary-red);
    color: white;
}

/* --- モーダル (編集画面) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #141414;
    padding: 30px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    color: white;
    border: 1px solid #333;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
}

.modal h2 { margin-top: 0; }

.modal label {
    display: block;
    margin-top: 15px;
    color: #aaa;
    font-size: 0.9rem;
}

.modal input,
.modal textarea {
    width: 100%;
    margin-top: 5px;
    padding: 12px;
    background: #333;
    border: 1px solid #444;
    color: white;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

.modal textarea {
    height: 100px;
    resize: none;
}

.save-btn {
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    margin-top: 25px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    font-size: 1rem;
}

.save-btn:hover {
    background-color: #f40612;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
    font-size: 28px;
    color: #aaa;
}

.close:hover { color: white; }

/* --- 広告用コンテナ --- */
.ad-container {
    margin: 20px auto;
    padding: 10px;
    background-color: transparent;
    text-align: center;
    max-width: 728px;
}

.ad-container.ad-top {
    margin-top: 30px;
    margin-bottom: 30px;
}

.ad-container.ad-inline {
    grid-column: span 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #202020;
    border-radius: 4px;
    min-height: 160px;
}

.ad-container.ad-inline ins {
    display: block;
    width: 100%;
    height: 100%;
}