/* リセットと基本設定 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
}

/* --- タイトル帯 (ブルーの帯) --- */
#app-header {
    /* リンクを絶対配置するために relative を設定 */
    position: relative; 
    background-color: #007bff;
    /* ... 既存のスタイル ... */
    background-color: #007bff; /* ブルー */
    color: white;
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* --- 🚨 親ページへのリンクスタイル 🚨 */
#parent-link {
    position: absolute;
    top: 15px;      /* 上からの位置 */
    left: 20px;     /* 左からの位置 */
    color: white;
    text-decoration: none; /* 下線を削除 */
    font-size: 16px;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    transition: background-color 0.2s;
}

#parent-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#app-header h1 {
    margin: 0;
    font-size: 24px;
}

#app-description {
    margin-top: 10px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

/* --- サイズ設定UIのスタイル --- */
#size-config {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#size-config label {
    font-weight: bold;
}

#size-config input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    color: #333;
}

#apply-size-btn {
    padding: 5px 15px;
    background-color: #28a745; /* 緑色 */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#apply-size-btn:hover {
    background-color: #218838;
}

/* --- 全体コンテナのレイアウト --- */
#app-container {
    display: flex; 
    gap: 20px;
    padding: 0 20px 20px 20px; 
    align-items: flex-start;
}

/* --- サイドバーコンテナ --- */
#sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 隙間を調整 */
}

/* --- サウンドリストエリアのコンテナ --- */
#sound-list-container {
    width: 250px;
    padding: 10px;
    border: 1px solid #ccc; 
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
}

/* --- タブ切り替えエリアのスタイル --- */
#sound-tabs {
    display: flex;
    flex-wrap: wrap; 
    gap: 5px;
    width: 250px;
    padding: 10px 0;
}

.tab-button {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    font-size: 14px;
}

.tab-button:hover {
    background-color: #e9ecef;
}

/* 選択中のタブのスタイル */
.tab-button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}
/* ------------------------------------------- */

.draggable-sound {
    padding: 8px;
    margin-bottom: 5px;
    background-color: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: grab;
    text-align: center;
    transition: background-color 0.1s;
}

.draggable-sound:hover {
    background-color: #cfe2ff;
}

/* --- パッドエリアとボタンのスタイル --- */
#sound-pad-container {
    display: grid;
    gap: 5px; 
    width: fit-content;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 8px;
    background-color: #fff;
}

.sound-pad {
    width: 96px;
    height: 96px;
    background-color: #f0f0f0; 
    color: #333;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
    user-select: none;
    transition: background-color 0.1s ease, border-color 0.1s ease;
    overflow: hidden; 
}

/* 未設定時：グレー表示 */
.sound-pad[data-sound=""] {
    background-color: #a0a0a0;
    color: #444;
    border-color: #777;
    font-weight: normal;
    font-size: 14px;
    opacity: 0.8;
    cursor: default; 
}

/* ホバー時の色: 青 */
.sound-pad:hover:not(.active):not([data-sound=""]) { 
    background-color: #007bff;
    border-color: #0056b3;
    color: white; 
}

/* 再生中（アクティブ）の色: 赤 */
.sound-pad.active {
    background-color: #dc3545; 
    border-color: #c82333;
    transform: scale(0.98);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    color: white;
}

/* ループモードが有効なパッドのスタイル */
.sound-pad.is-loop {
    border-color: #00bcd4; /* シアン系の枠線 */
    position: relative;
}

/* ループモードアイコンのスタイル */
.sound-pad.is-loop::after {
    content: "🔁"; /* アイコン */
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
    line-height: 1;
    color: #00bcd4; /* シアン */
}

/* 全停止パッドのコンテナ */
#stop-all-container {
    width: 120px;
    padding: 5px 0;
}

#stop-all-button {
    width: 100%;
    height: 100px;
    background-color: #dc3545; /* 赤色 */
    color: white;
    border: 3px solid #a71d2a;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.1s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#stop-all-button:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.3);
}

#stop-all-button:active {
    background-color: #a71d2a;
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}