/* ==========================================
   Bridal Screen Image Generator - Stylesheet
   Design Theme: Luxury Gold & Pearl White
   ========================================== */

/* 1. 変数定義・リセット */
:root {
    --bg-dark: #0f0e0c;         /* ダークブロンズ背景 */
    --panel-bg: rgba(26, 24, 21, 0.75); /* 半透明パネル背景 */
    --border-color: rgba(212, 175, 55, 0.25); /* ゴールドボーダー */
    --border-hover: rgba(212, 175, 55, 0.6);
    --gold: #d4af37;            /* クラシックゴールド */
    --gold-light: #f3e5ab;      /* ライトゴールド */
    --gold-gradient: linear-gradient(135deg, #b38728, #fbf5b7, #daae3f, #aa771c);
    --text-main: #f5f4f0;       /* パールホワイト */
    --text-muted: #bdae9c;      /* ブロンズがかったグレー */
    --accent: #e5c158;
    --radius-lg: 16px;
    --radius-md: 8px;
    --transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', 'Noto Serif JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* 背景に微細なグラデーションとラグジュアリー感を演出 */
    background-image: 
        radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(170, 119, 28, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

/* 2. レイアウト構造 */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* ヘッダー */
.app-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 8px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wedding-icon {
    font-size: 24px;
    color: var(--gold);
    animation: pulse 3s infinite ease-in-out;
}

.app-header h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 26px;
    letter-spacing: 2px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version-tag {
    font-size: 11px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
}

.app-header .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* メインコンテンツ */
.main-content {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 24px;
    flex: 1;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 3. コンポーネントスタイル */
/* グラスモルフィズムカード */
.glass {
    background: var(--panel-bg);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* コントロールパネル */
.control-panel {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 88vh;
    overflow-y: auto;
}

/* カスタムスクロールバー */
.control-panel::-webkit-scrollbar {
    width: 6px;
}
.control-panel::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.control-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
.control-panel::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.control-panel h2 {
    font-size: 16px;
    font-family: 'Playfair Display', serif;
    letter-spacing: 1px;
    color: var(--gold-light);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-icon {
    color: var(--gold);
}

.section-desc {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* 設定グループ */
.config-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.config-group h3 {
    font-size: 13px;
    color: var(--gold-light);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    font-weight: 500;
    border-left: 3px solid var(--gold);
    padding-left: 8px;
}

/* 4. 調整スライダーのスタイル */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-row > span:first-child {
    width: 100px;
    font-size: 10px;
    color: var(--text-muted);
}

.slider-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    outline: none;
    margin: 0;
    accent-color: var(--gold); /* 青からゴールドに変更 */
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease;
}

.slider-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    background: var(--gold-light);
}

/* 数値入力欄のスタイル */
.val-input {
    width: 48px;
    height: 20px;
    text-align: right;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    color: var(--gold-light);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 0 4px;
    outline: none;
    transition: var(--transition);
}

.val-input:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
}

/* スピンボタン（上下矢印）の非表示化 */
.val-input::-webkit-outer-spin-button,
.val-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.val-input[type="number"] {
    -moz-appearance: textfield;
}

/* コピーボタンのスタイル */
.export-params-wrapper {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid var(--border-color);
    color: var(--gold-light);
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--border-hover);
    color: var(--text-main);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.copy-status-text {
    font-size: 10px;
    color: var(--gold);
    font-weight: 600;
    transition: var(--transition);
}

/* 一般入力 */
label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

select, input[type="text"], input[type="number"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-main);
    padding: 8px 12px;
    font-size: 13px;
    width: 100%;
    outline: none;
    transition: var(--transition);
}

select:focus, input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

select option {
    background: #1c1a17;
    color: var(--text-main);
}

/* テキスト個別編集ブロック */
.text-edit-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.text-edit-block:last-of-type {
    margin-bottom: 0px;
}

.text-edit-block > label {
    font-size: 11px;
    color: var(--gold-light);
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

/* ボタン関係 */
.btn-primary {
    background: var(--gold-gradient);
    border: none;
    color: #1c1a17;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(1px);
}

.output-group {
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.hidden {
    display: none !important;
}

/* 5. プレビュー用キャンバスの背景スタイル (透過プレビュー用) */
#preview-canvas.checkerboard {
    background-color: #1a1a1a;
    background-image: 
        linear-gradient(45deg, #242424 25%, transparent 25%, transparent 75%, #242424 75%, #242424), 
        linear-gradient(45deg, #242424 25%, transparent 25%, transparent 75%, #242424 75%, #242424);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}

#preview-canvas.dark {
    background-color: #0c0b0a;
    background-image: none;
}

/* 6. プレビューパネル */
.preview-panel {
    display: flex;
    flex-direction: column;
}

.preview-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-card h2 {
    font-size: 18px;
    font-family: 'Playfair Display', serif;
    color: var(--gold-light);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aspect-ratio-tag {
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* プレビュー用キャンバスコンテナ (背景はCSSで変更、16:10を強制維持) */
.canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10; /* 16:9 から 16:10 に変更 */
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#preview-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: background-color 0.2s ease, background-image 0.2s ease;
}

/* プレイヤーコントロール (背景トグル用) */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
    gap: 12px;
}

.bg-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-control:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--border-hover);
    color: var(--gold-light);
}

.btn-control.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
    color: var(--text-main);
    font-weight: 500;
}

.center-line-toggle {
    display: flex;
    align-items: center;
}

.toggle-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 11px;
    color: var(--text-muted);
    transition: var(--transition);
}

.toggle-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    margin: 0;
}

.toggle-checkbox input[type="checkbox"]:checked {
    background: var(--gold);
    border-color: var(--gold);
}

.toggle-checkbox input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    color: #1c1a17;
    font-size: 10px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
}

.toggle-checkbox:hover {
    color: var(--gold-light);
}

.toggle-checkbox:hover input[type="checkbox"] {
    border-color: var(--gold-light);
}

.res-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* ヒントカード */
.tips-card {
    background: rgba(212, 175, 55, 0.04);
    border: 1px dashed rgba(212, 175, 55, 0.18);
    border-radius: 8px;
    padding: 16px;
    margin-top: auto;
}

.tips-card h4 {
    font-size: 12px;
    color: var(--gold-light);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tips-card ul {
    list-style-type: none;
}

.tips-card li {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.5;
    position: relative;
    padding-left: 12px;
}

.tips-card li::before {
    content: "✦";
    color: var(--gold);
    position: absolute;
    left: 0;
    font-size: 8px;
    top: 2px;
}

.tips-card li:last-child {
    margin-bottom: 0;
}

/* 7. フッター */
.app-footer {
    text-align: center;
    padding: 16px 0 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

.app-footer p {
    font-size: 11px;
    color: var(--text-muted);
}

/* アニメーション効果 */
@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}