/* style.css (Final Production Version) */

/* 基本的なリセットとフォント設定 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #1a1a1a;
    color: #f5f5f5;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* コンテナ */
.container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #2c2c2c;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
    text-align: center;
}

/* ヘッダー */
.header h1 {
    /* アーティスト名 */
    font-size: 1.8em;
    margin-bottom: 4px;
    /* 余白を調整 */
    color: #ffffff;
    word-break: keep-all;
    font-weight: 700;
}

.header h2 {
    /* タイトル */
    font-size: 1.2em;
    /* アーティスト名より少し小さく */
    margin-top: 0;
    margin-bottom: 8px;
    color: #cccccc;
    /* 少し薄い色に */
    word-break: keep-all;
    font-weight: 400;
}

/* アートワークコンテナ - スマホ専用サイズ */
.artwork-container {
    width: 100%;
    max-width: 240px;
    /* 実物サイズ（4cm）に近い */
    margin: 0 auto 30px;
    position: relative;
    aspect-ratio: 1 / 1;
    /* background-color: #f0f0f0; */
    /* background-color: #2c2c2c; */
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

/* プレースホルダー */
.artwork-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    /* background-color: #2c2c2c; */
    background-color: #1a1a1a;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.artwork-placeholder.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Loading テキスト */
.loading-text {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* メインアートワーク */
.main-artwork {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.main-artwork.loaded {
    opacity: 1;
}

/* サービス選択ボタンセクション */
.service-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* ボタン間の余白を調整 */
    margin-bottom: 30px;
}

.service-button {
    display: none;
    /* 初期状態では非表示 */
    align-items: center;
    /* アイコンとテキストを垂直中央揃え */
    background-color: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 10px;
    padding: 10px 15px;
    /* パディングを調整して高さを抑える */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.service-button:hover {
    background-color: #4a4a4a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* アイコン */
.service-icon {
    font-size: 22px;
    /* アイコンサイズ */
    margin-right: 12px;
    /* アイコンとテキストの間の余白 */
    width: 28px;
    /* アイコンの幅を固定してレイアウトを安定させる */
    text-align: center;
    flex-shrink: 0;
    /* アイコンが縮まないように */
}

/* ボタンのコンテンツ部分 */
.button-content {
    flex-grow: 1;
    /* 残りのスペースを埋める */
    text-align: left;
    overflow: hidden;
    /* サブテキストのはみ出しに対応 */
}

.button-text {
    font-weight: 700;
    font-size: 1.1em;
    color: #ffffff;
}

/* URL表示用のサブテキスト */
.button-subtext {
    font-size: 0.8em;
    color: #888;
    /* 薄いグレーで見やすく */
    margin-top: 2px;
    white-space: nowrap;
    /* 折り返さない */
    overflow: hidden;
    /* はみ出した部分を隠す */
    text-overflow: ellipsis;
    /* はみ出した部分を...で表示 */
}

/* 設定変更セクション */
.settings-section {
    margin-top: 30px;
    border-top: 1px solid #444444;
    padding-top: 20px;
}

.settings-button {
    background-color: #5a5a5a;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.2s ease;
}

.settings-button:hover {
    background-color: #6a6a6a;
}

/* フッター */
.footer {
    margin-top: 40px;
    font-size: 0.8em;
    color: #888888;
}

.footer a {
    color: #888888;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* エラー表示用コンテナ */
.error-display-container {
    display: none;
    /* 初期状態では完全に非表示 */
}

.error-display-container.active {
    display: flex;
    /* エラー時に表示 */
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    text-align: center;
    background-color: #2c2c2c;
    color: #f5f5f5;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
    margin: 20px auto;
    max-width: 600px;
    min-height: 300px;
}

.error-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.error-title {
    font-size: 1.8em;
    margin-bottom: 8px;
    color: #ff0000;
    word-break: keep-all;
}

.error-message-text,
.error-suggestion-text {
    font-size: 1.1em;
    color: #cccccc;
    margin-bottom: 10px;
}

.footer-link {
    color: #888888;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {

    .container,
    .error-display-container.active {
        margin: 10px;
        padding: 15px;
    }

    .header h1,
    .error-title {
        font-size: 1.5em;
    }

    .header h2 {
        font-size: 1.1em;
    }

    .service-button {
        padding: 10px 15px;
    }
}

/* style.css の末尾に追記 */

/* システムメッセージ用コンテナ (エラーコンテナを流用し、スタイルを上書き) */
.error-display-container.system-message {
    position: fixed;
    /* 画面に固定 */
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    /* メッセージの最大幅 */
    z-index: 1000;
    background-color: #1DB954;
    /* 成功を示す緑色 */
    color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-height: auto;
    /* 高さは自動 */
    display: block;
    text-align: center;
}

.system-message-content-wrapper .system-title {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.system-message-content-wrapper .system-message-text {
    font-size: 1em;
    margin: 0;
}

/* 未紐付け時に表示する大きめ入力 */
.unlinked-group-id-input {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 600;
    padding: 6px 14px;
    border: 2px solid #444;
    border-radius: 10px;
    background: #fff;
    color: #222;
    max-width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
    letter-spacing: .5px;
}

.unlinked-group-id-input:focus {
    outline: 3px solid #3388ff33;
    border-color: #2266cc;
}