/* 全体のスタイル */
body {
    background-color: rgba(0,0,0,0);
    font-family: 'Poppins', 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
    color: #343A40;
    line-height: 1.6;
}

/* コンテナ */
.container {
    max-width: 650px;
    margin: auto;
    padding: 20px 40px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, #dee2e6, #f9f9f9, #dee2e6);
    margin: 16px 0;
}

/* タイトル */
h1 {
    text-align: center;
    margin: 5px 0 10px 5px;
    font-size: 14px;
    letter-spacing: 4px;
    color: #495057;
}

/* ボタンデザイン */
.button-group {
    display: flex;
    justify-content: left;
    align-items: center;
    gap: 40px;
    width: 100%;
    margin-bottom: 20px;
}

.btn,
.copy-btn {
    padding: 8px 60px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.reset-btn {
    margin-left: auto;
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    background: #28a745;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.settings-btn {
    padding: 4px 30px 4px 30px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* ホバー時 */
.btn:hover,
.toggle-btn:hover,
.copy-btn:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}
.reset-btn:hover {
    background: #218838;
}

/* 無効化されたボタン */
.btn:disabled,
.reset-btn:disabled,
.toggle-btn:disabled,
.copy-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* 点滅アニメーション */
@keyframes blink {
    0% { background-color: #ff9800; }
    50% { background-color: #ffb74d; }
    100% { background-color: #ff9800; }
}

/* ゆっくり点滅 */
.btn.active {
    animation: blink 2s infinite ease-in-out;
}

/* 設定の表示 */
.settings-container {
    display: flex;
    flex-direction: column;
    padding: 4px 10px 4px 10px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.settings-header {
    font-size: 14px;
    letter-spacing: 4px;
    cursor: pointer;
    padding: 10px;
    background: #f9f9f9;
    text-align: center;
}

.settings-content {
    padding: 4px;
}

details[open] .settings-header {
    background: #d9d9d9;
}

.settings-item {
    display: flex;
    font-size: 14px;
    justify-content: space-between;
    padding: 8px 0;
    flex-wrap: wrap;
}

.settings-label {
    flex: 0.25;
    color: #495057;
}

.settings-word {
    flex: 0.65;
    text-align: left;
    width: 40ch;
}

.settings-symbol {
    flex: 0.05;
    color: #495057;
    text-align: center;
    display: inline-block;
    min-width: 20px;
}

.settings-weight,
.settings-retry {
    flex: 0.05;
    width: 10ch;
}

.settings-value {
    flex: 0.25;
    min-width: 150px;
}

/* テキスト・数値入力 */
.settings-item input[type="text"],
.settings-item input[type="password"],
.settings-item input[type="number"],
.settings-item select {
    padding: 4px;
    font-size: 16px;
    font-family: 'Poppins', 'Arial', sans-serif;
    border: 1px solid #adb5bd;
    border-radius: 6px;
    background-color: #ffffff;
    transition: border-color 0.3s, box-shadow 0.3s;
    color: #222222;
}

/* selectタグのスタイル */
.settings-item select {
    cursor: pointer;
    padding: 6px 8px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 32px;
}

.settings-item select:hover {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.settings-item select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 数値入力は右寄せ */
.settings-item input[type="number"] {
    text-align: right;
}

/* 無効化された入力 */
.settings-item input[disabled] {
    background-color: #f1f3f5;
    color: #6c757d;
}

/* 最新のコメント取得時間 */
.latest-info {
    font-size: 14px;
    color: #495057;
    text-align: right;
    padding: 8px 15px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#lastFetchTime {
    letter-spacing: 6px;
    color: #d63384;
}

/* 合計ポイント(カスタマイズ可能) */
.totalPoints-container {
    font-size: var(--totalPointsFontSize, 30px);
    color: var(--totalPointsTextColor, #495057);
    background-color: var(--totalPointsBgColor, rgba(248, 249, 250, 0));
    display: flex;
    flex-direction: column;
    padding: 5px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
}

/* 非表示時のスタイル */
.totalPoints-container.hide-label .totalPoints-item {
    justify-content: center;
}

.totalPoints-container.hide-label .totalPoints-label {
    display: none;
}

/* 合計項目全体のスタイル */
.totalPoints-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
}

/* 合計ラベルのスタイル */
.totalPoints-label {
    letter-spacing: 10px;
}

/* 数値のスタイル */
#totalPointsDisplay {
    letter-spacing: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* ポイント換算 */
.points-container {
    display: flex;
    flex-direction: column;
    background-color: #FDE8EF;
    padding: 5px 15px 5px 15px;
    border: 1px solid #F5C6CB;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(242, 132, 159, 0.2);
}

.points-container h2 {
    font-size: 12px; 
    letter-spacing: 6px;
    color: #C2185B;
}

.points-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #F5C6CB;
}

.points-item:last-child {
    border-bottom: none;
}

.points-label {
    font-size: 14px; 
    letter-spacing: 6px;
    color: #C2185B;
}

.points-value {
    font-size: 16px;
    letter-spacing: 10px;
    color: #C2185B;
}

/* 集計結果 */
.stats-container {
    display: flex;
    flex-direction: column;
    background-color: #E3F2FD;
    padding: 5px 15px 5px 15px;
    border: 1px solid #BBDEFB;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(100, 149, 237, 0.2);
}

.stats-container h2 {
    font-size: 12px; 
    letter-spacing: 6px;
    color: #1565C0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #BBDEFB;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 14px; 
    letter-spacing: 6px;
    color: #1565C0;
}

.stat-value {
    font-size: 16px;
    letter-spacing: 10px;
    color: #1565C0;
}

/* 詳細内容コントロール */
.details-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.details-control h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: 10px;
    color: #495057;
}

/* ライブチャット表示 */
.chat-container {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.chat-area {
    font-family: monospace;
    white-space: pre-wrap;
    height: 300px;
    overflow-y: auto;
}

/* ライブチャット内の名前、スーパーチャット、メンバー加入などのスタイル */
.chat-message {
    margin-bottom: 5px;
    line-height: 1.4;
}

.chat-author {
    font-weight: bold;
    color: #212529;
}

.chat-text {
    color: #495057;
}

.chat-superchat {
    color: #dc3545;
    font-weight: bold;
}

.chat-membership {
    color: #1e7e34;
    font-weight: bold;
}

.chat-membershipgift {
    color: #28a745;
}

.chat-supersticker {
    color: #ff5733;
    font-weight: bold;
}

.chat-specialword {
    color: #007bff;
    font-weight: bold;
}

/* 動画情報 */
.details-container {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.details-area {
    font-family: monospace;
    white-space: pre-wrap;
    height: 80px;
    overflow-y: auto;
}

/* ステータス表示（共通・初期状態は透明） */
.status {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: bold;
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 5px;
    position: relative;
    transition: all 0.5s ease-in-out;
    color: transparent;
    opacity: 0;
}

/* 配信中（緑色） or 低速モード */
.executing, .slowmode {
    color: #28a745;
    border: 2px solid #28a745;
    border-image: linear-gradient(45deg, #28a745, #34d058, #28a745) 1;
    opacity: 1; /* フェードイン */
    animation: slowBlink 2s infinite ease-in-out, glow 2s infinite ease-in-out;
}

/* 一時停止 (オレンジ色) */
.pause {
    color: #ff9800;
    border: 2px solid #ff9800;
    border-image: linear-gradient(45deg, #ff9800, #ffc107, #ff9800) 1;
    opacity: 1;
}

/* 配信終了（赤色）*/
.stopped {
    color: #d32f2f;
    border: 2px solid #d32f2f;
    border-image: linear-gradient(45deg, #d32f2f, #ff6666, #d32f2f) 1;
    opacity: 1;
}

/* 点滅アニメーション */
@keyframes slowBlink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 発光アニメーション */
@keyframes glow {
    0% { box-shadow: 0px 0px 5px rgba(40, 167, 69, 0.5); }
    50% { box-shadow: 0px 0px 15px rgba(40, 167, 69, 0.8); }
    100% { box-shadow: 0px 0px 5px rgba(40, 167, 69, 0.5); }
}

/* 通知のスタイル */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    animation: fadeInOut 3s forwards; /* 表示と消えるアニメーション */
}

.notification.error {
    background-color: #dc3545;
}

/* 通知のフェードイン・フェードアウトアニメーション */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

/* トグルスイッチのコンテナ */
.toggle-container {
    display: flex;
    justify-content: flex-end; /* 右寄せ */
    align-items: center;
    margin-bottom: 8px; /* 下のチャットエリアとの間隔 */
}

/* トグルスイッチのラベル */
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    position: relative;
    user-select: none;
}

/* チェックボックスを隠す */
.toggle-label input[type="checkbox"] {
    display: none;
}

/* スライダーのスタイル */
.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: background-color 0.3s ease;
    margin-left: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* スライダーの丸いハンドル */
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* チェック時のスライダー */
.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background-color: #28a745;
}

/* チェック時のハンドル移動 */
.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* モーダル全体（初期状態は非表示） */
.exchangeRates-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    
    /* 初期状態 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* モーダルコンテンツ（中央配置） */
.exchangeRates-modal-content {
    background: #F8F9FA;
    padding: 20px;
    width: 600px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* 初期状態 */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* モーダル表示時 */
.exchangeRates-modal.show {
    opacity: 1;
    visibility: visible;
}

.exchangeRates-modal.show .exchangeRates-modal-content {
    opacity: 1;
}

/* モーダルのタイトル */
.exchangeRates-modal-content h2 {
    font-size: 14px;
    letter-spacing: 4px;
    color: #495057;
    text-align: center;
    margin-bottom: 15px;
}

/* モーダルのスクロール可能なコンテンツ */
.exchangeRates-scrollable {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #CED4DA;
    border-radius: 6px;
    background-color: #E9ECEF;
    padding: 10px;
}

/* 閉じるボタン */
.exchangeRates-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    transition: 0.3s;
}

.exchangeRates-close:hover {
    color: #DC3545; /* 赤くして強調 */
}

/* テーブル */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: #ADB5BD; /* スモーキーグレー */
    color: #FFF;
}

th, td {
    padding: 8px;
    border-bottom: 1px solid #CED4DA;
    text-align: center;
}

/* 交互に色を変える */
tbody tr:nth-child(even) {
    background: #F1F3F5;
}

tbody tr:hover {
    background: #DEE2E6;
    transition: background 0.2s;
}

/* 為替レートテーブル全体のスタイル */
#exchangeRateTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* ヘッダーの固定 */
#exchangeRateTable thead {
    margin: 0;
    padding: 0;
    position: sticky; /* スクロールしても固定 */
    top: 0;
    background: #E9ECEF;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ヘッダー（通貨コード・国名・レート） */
#exchangeRateTable th {
    padding: 10px;
    background: #E9ECEF;
    color: #495057;
    text-align: center;
    border-bottom: 2px solid #ADB5BD;
}

/* 列幅の調整 */
#exchangeRateTable th:nth-child(1), /* 通貨コード */
#exchangeRateTable td:nth-child(1) {
    font-size: 14px;
    letter-spacing: 4px;
    width: 20%;
}

#exchangeRateTable th:nth-child(2), /* 通貨記号 */
#exchangeRateTable td:nth-child(2) {
    font-size: 14px;
    text-align: center;
    width: 20%;
}

#exchangeRateTable th:nth-child(3), /* 国名 */
#exchangeRateTable td:nth-child(3) {
    font-size: 14px;
    letter-spacing: 4px;
    text-align: center;
    width: 30%;
}

#exchangeRateTable th:nth-child(4), /* レート */
#exchangeRateTable td:nth-child(4) {
    font-size: 14px;
    width: 30%;
    text-align: center;
}

/* レートの入力欄 */
#exchangeRateTable input[type="number"] {
    text-align: right;
    width: 100px;
    height: 32px;
    font-size: 14px;
    padding-right: 10px;
    border: 1px solid #ADB5BD;
    border-radius: 4px;
    background-color: #ffffff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* 無効化されたレートの入力欄 */
#exchangeRateTable input[disabled] {
    background-color: #f1f3f5;
    color: #6c757d;
}

/* モーダルウィンドウのスクロール領域 */
.exchangeRates-scrollable {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #CED4DA;
    border-radius: 6px;
    background-color: #E9ECEF;
    padding: 10px;
    position: relative; /* 相対位置 */
    padding: 0;
}

/* 為替レート設定モーダルのボタン配置 */
.exchangeRates-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ボタンのスタイル */
.exchangeRates-btn {
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    text-align: center;
    min-width: 100px;
}

/* 保存ボタン */
.exchangeRates-btn:not(.reset) {
    background: #007BFF;
}

.exchangeRates-btn:not(.reset):hover {
    background: #0056b3;
}

/* 初期化ボタン */
.exchangeRates-btn.reset {
    background: #28a745;
}

.exchangeRates-btn.reset:hover {
    background: #218838;
}

/* ライセンス表記 */
.exchangeRates-license-note {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 8px;
    text-align: left;
}

.exchangeRates-license-note a {
    color: #6c757d;
    text-decoration: underline;
}

/* フェードインアニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* カラーピッカーの外観を整える */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="color"] {
    appearance: none; /* デフォルトのボタンを非表示 */
    border: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

input[type="color"]::-webkit-color-swatch {
    border-radius: 4px;
    border: 2px solid #ccc;
}

input[type="color"]::-moz-color-swatch {
    border-radius: 4px;
    border: 2px solid #ccc;
}

/* カラーコードの表示 */
.color-code {
    font-family: monospace;
    font-size: 12px;
    color: #333;
}

/* レイアウト調整 */
@media (max-width: 768px) {
    .settings-label, .settings-word, .settings-weight, .settings-symbol, .settings-retry {
        flex: none;
        width: 100%;
        margin-bottom: 8px;
    }
}