/* settings.css - 設定画面スタイル */
.settings-content {
    text-align: left;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid var(--ui-border);
}

.settings-section h3 {
    margin: 0 0 15px 0;
    color: var(--accent-secondary);
    border-bottom: 1px solid var(--ui-border);
    padding-bottom: 8px;
}

.setting-item {
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* 設定項目に視覚的なフィードバックを追加 */
.setting-item:focus-within {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 5px;
    margin: -5px;
    transition: all 0.2s ease;
}

.setting-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.1em;
}

.setting-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--ui-border);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.setting-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.setting-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
}

.volume-label {
    min-width: 120px;
    font-size: 1.1em;
}

.volume-slider {
    flex: 1;
    margin: 0 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    height: 6px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-secondary);
    border-radius: 50%;
    cursor: pointer;
}

.volume-value {
    min-width: 40px;
    text-align: right;
    font-weight: bold;
}

.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.theme-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.15);
}

.theme-preview {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* BGMプレビューの波形アニメーション */
.bgm-preview {
    background: linear-gradient(45deg, var(--bg-primary), var(--bg-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
}

.waveform {
    width: 80%;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.waveform::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 100%;
    background: var(--accent-secondary);
    animation: waveform 1s ease-in-out infinite;
}

@keyframes waveform {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* ビジュアルテーマプレビュー */
.visual-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary, #1a1a2e);
    position: relative;
    overflow: hidden;
}

.preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    height: 100%;
    justify-content: flex-end;
    padding-bottom: 10px;
}

.preview-block {
    width: 30px;
    height: 12px;
    margin: 1px;
    border-radius: 3px;
    background: var(--block-normal, #3498db);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.preview-paddle {
    width: 50px;
    height: 10px;
    border-radius: 5px;
    background: var(--paddle-color, #e74c3c);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.preview-ball {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ball-color, #f1c40f);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.theme-name {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.bpm {
    display: block;
    font-size: 0.8em;
    opacity: 0.7;
}

.preview-btn {
    background: var(--accent-primary);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: white;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.3s ease;
}

.preview-btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.1);
}

.settings-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

#test-sfx {
    margin-top: 10px;
}

/* テーマごとのプレビュー背景色を設定 */
.theme-default .visual-preview {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.theme-space .visual-preview {
    background: linear-gradient(135deg, #0f0f23, #1a1a2e);
}

.theme-ocean .visual-preview {
    background: linear-gradient(135deg, #1a5f7a, #1597bb);
}

.theme-forest .visual-preview {
    background: linear-gradient(135deg, #2d5a27, #3e7c3e);
}

.theme-retro .visual-preview {
    background: linear-gradient(135deg, #2d1b69, #4a2c8a);
}

/* アクティブなテーマオプションのスタイル強化 */
.theme-option.active {
    border-color: var(--accent-secondary, #e74c3c);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    transform: translateY(-2px);
}

.theme-option.active .theme-name {
    color: var(--accent-secondary, #e74c3c);
    font-weight: bold;
}

/* settings.css - エクスポート/インポートセクションのスタイル */

.export-import-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.export-import-buttons .btn-secondary {
    flex: 1;
    min-width: 140px;
}

/* キーボードショートカットのヒント */
.keyboard-hint {
    font-size: 0.8em;
    opacity: 0.6;
    margin-top: 5px;
}

/* 無効なボタンのスタイル */
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

/* 設定項目の無効状態 */
.setting-item.disabled {
    opacity: 0.6;
}

.setting-item.disabled .setting-label {
    cursor: not-allowed;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .settings-content {
        padding: 20px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .volume-slider {
        margin: 10px 0;
        width: 100%;
    }
    
    .theme-selector-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .settings-buttons {
        flex-direction: column;
    }
    
    .export-import-buttons {
        flex-direction: column;
    }
    
    .export-import-buttons .btn-secondary {
        min-width: auto;
    }
}