/* =========================================
   notification.css - 通知システム
   ========================================= */

/* ベルマークのラッパー（基準点） */
.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-wrapper .icon {
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.notification-wrapper .icon:hover {
    color: var(--gray-text);
}

/* 通知バッジ（・ または 数字） */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background-color: var(--flixer-red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 8px; /* 「・」の時は丸く小さくするため */
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* ドロップダウンメニュー（深層すりガラス） */
.notification-menu {
    position: absolute;
    top: 45px;
    right: -10px;
    width: 380px;
    max-height: 500px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s;
    z-index: 1000;
}

/* メニューを開いたときのクラス */
.notification-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* メニューのヘッダー */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.notification-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
}

.mark-read {
    font-size: 0.85rem;
    color: var(--gray-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.mark-read:hover {
    color: white;
}

/* 通知リスト本体 */
.notification-list {
    overflow-y: auto;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.notification-list::-webkit-scrollbar {
    width: 6px;
}
.notification-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ===== トースト通知（画面上部） ===== */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    gap: 10px;
}

.toast-message {
    font-family: 'Noto Sans JP', sans-serif;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: toast-slide-in 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards,
               toast-fade-out 0.3s ease-in forwards;
    animation-delay: 0s, var(--toast-duration, 3s);
}

@keyframes toast-slide-in {
    0% { opacity: 0; transform: translateY(-20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-fade-out {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* home-layout.css または適切なCSSファイルに追加 */
.notification-item.is-clickable {
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item.is-clickable:hover {
    background: rgba(255, 255, 255, 0.1); /* ホバー時に少し明るくする */
}

.notification-item.is-clickable:active {
    background: rgba(255, 255, 255, 0.2); /* クリックした瞬間にさらに明るく */
}

.notification-item {
    display: flex;
    flex-direction: row;
    padding: 20px 24px; /* さらに余白を拡大 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 20px; /* 画像とテキストの間隔を広げる */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: flex-start;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-item.unread {
    background: rgba(229, 9, 20, 0.08);
    border-left: 4px solid var(--flixer-red); /* 太く強調 */
}

/* テキストエリア */
.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-header {
    display: flex;
    flex-direction: column; /* 日付をタイトルの下に配置してゆとりを出す */
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 4px;
}

.notif-title {
    font-size: 1.1rem; /* 拡大 */
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.notif-body {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* 4行まで拡大 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 画像エリア（ポスター） - 大幅拡大 */
.notif-image {
    width: 100px;  /* 80px から 100px へ */
    height: 145px; /* 115px から 145px へ */
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.notif-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.notification-item:hover .notif-image img {
    transform: scale(1.1);
}

/* ===== 支払い期限警告バナー（画面最上部） ===== */
.expiry-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 35px; /* スリムなデザイン */
    background: linear-gradient(90deg, var(--expiry-color, #e50914), #000);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    z-index: 20000; /* ナビバーより上 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    animation: banner-slide-down 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes banner-slide-down {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* 控えめな通知ドット（一週間前など） */
.expiry-dot {
    width: 8px;
    height: 8px;
    background-color: var(--expiry-color, #00a4dc);
    border-radius: 50%;
    position: absolute;
    top: 0;
    right: -2px;
    box-shadow: 0 0 5px var(--expiry-color, #00a4dc);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* バナー表示中のための調整 */
body.has-expiry-banner #navbar {
    top: 35px; /* バナーの分だけナビバーを下げる */
}
body.has-expiry-banner {
    padding-top: 35px;
}

/* 🌟 プレイヤー表示中はバナーと余白を無効化する */
body.player-active .expiry-banner {
    display: none !important;
}
body.player-active.has-expiry-banner {
    padding-top: 0 !important;
}