/* ============================================================ */
/* 13. src/static_visages/css/style.css - 完全版 */
/* ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #0d0d1a;
    color: #ddd;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ============================================================ */
/* ヘッダー */
/* ============================================================ */
#header {
    display: flex;
    align-items: center;
    background: #1a1a2e;
    padding: 6px 16px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    min-height: 44px;
}

#header .logo {
    font-weight: bold;
    font-size: 18px;
    color: #e67e22;
    margin-right: 24px;
}

#header .menu-group {
    display: flex;
    gap: 4px;
}

#header .dropdown {
    position: relative;
    display: inline-block;
}

#header .dropdown > button {
    background: transparent;
    border: none;
    color: #ccc;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
}

#header .dropdown > button:hover {
    background: #333;
    color: #fff;
}

#header .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1a1a2e;
    min-width: 180px;
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.6);
    z-index: 1000;
    padding: 4px 0;
}

#header .dropdown:hover .dropdown-content {
    display: block;
}

#header .dropdown-content button {
    display: block;
    width: 100%;
    padding: 6px 16px;
    background: transparent;
    border: none;
    color: #ccc;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

#header .dropdown-content button:hover {
    background: #2a2a4a;
    color: #fff;
}

#header .dropdown-content hr {
    border: none;
    border-top: 1px solid #333;
    margin: 4px 8px;
}

#user-info {
    color: #888;
    font-size: 12px;
}

#user-id, #user-email {
    color: #aaa;
}

/* ============================================================ */
/* メインコンテンツ */
/* ============================================================ */
#main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#col1, #col2, #col4 {
    background: #111120;
    padding: 8px 10px;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 1px solid #222;
}

#col1 { width: 160px; }
#col2 { width: 150px; }
#col4 { width: 190px; border-right: none; border-left: 1px solid #222; }

#col3 {
    flex: 1;
    background: #0d0d1a;
    overflow: hidden;
    position: relative;
}

#three-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================================ */
/* パネル */
/* ============================================================ */
.panel-title {
    font-size: 11px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    border-bottom: 1px solid #222;
    padding-bottom: 4px;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.btn-group button {
    padding: 5px 10px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 3px;
    color: #bbb;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
    transition: all 0.15s;
}

.btn-group button:hover {
    background: #2a2a4a;
    border-color: #555;
}

.btn-group button.active {
    background: #2a2a5a;
    border-color: #6677cc;
    color: #fff;
}

.btn-group button.danger {
    color: #e74c3c;
}

.btn-group button.danger:hover {
    background: #3a1a1a;
    border-color: #e74c3c;
}

hr {
    border: none;
    border-top: 1px solid #222;
    margin: 6px 0;
}

/* ============================================================ */
/* 移動ガイド */
/* ============================================================ */
.move-guide {
    font-family: 'Consolas', 'Monaco', monospace;
}

.move-guide span {
    font-size: 10px;
}

.move-guide hr {
    opacity: 0.5;
}

.move-guide #move-step-value {
    color: #44ff88;
}

.move-guide #move-selected-count {
    color: #44aaff;
}

/* ============================================================ */
/* ワークショップ表示チェックボックス / 編集対象ラジオボタン */
/* ============================================================ */
.workshop-visibility-list,
.workshop-edit-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: #aaa;
}

.workshop-visibility-list label,
.workshop-edit-list label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 2px 0;
}

.workshop-visibility-list input[type="checkbox"] {
    accent-color: #4a6daa;
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.workshop-edit-list input[type="radio"] {
    accent-color: #aa6a4a;
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.workshop-visibility-list label:hover,
.workshop-edit-list label:hover {
    color: #ddd;
}

.workshop-edit-list label:has(input[type="radio"]:checked) {
    color: #ffaa44;
    font-weight: bold;
}

/* ============================================================ */
/* 左右鏡像コピーボタン */
/* ============================================================ */
#btn-mirror-copy {
    background: #2d4a6a;
    color: #fff;
    border: 1px solid #3a6a8a;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}

#btn-mirror-copy:hover {
    background: #3a6a8a;
    border-color: #4a8aaa;
}

#btn-mirror-copy:active {
    background: #1a3a5a;
}

/* ============================================================ */
/* ダイアログ */
/* ============================================================ */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.dialog-overlay.active {
    display: flex;
}

.dialog-content {
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #333;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #222;
}

.dialog-header h3 {
    margin: 0;
    color: #eee;
    font-size: 16px;
}

.dialog-header .close-dialog {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.dialog-header .close-dialog:hover {
    color: #fff;
}

.dialog-body {
    padding: 16px;
}

.dialog-footer {
    padding: 12px 16px;
    border-top: 1px solid #222;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================================ */
/* マスクリスト */
/* ============================================================ */
#mask-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#mask-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
    color: #ccc;
}

#mask-list li:hover {
    background: #1a1a3a;
}

#mask-list li .delete-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

#mask-list li .delete-btn:hover {
    color: #e74c3c;
}

/* ============================================================ */
/* スクロールバー */
/* ============================================================ */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: #0d0d1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================================ */
/* フッター（ステータスバー） */
/* ============================================================ */
#footer {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #111120;
    padding: 4px 16px;
    border-top: 1px solid #222;
    flex-shrink: 0;
    font-size: 11px;
    color: #666;
    min-height: 28px;
}

#footer span {
    color: #888;
}

#footer .status-label {
    color: #555;
}

#footer .status-value {
    color: #aac;
}

/* ============================================================ */
/* 部品生成パネル */
/* ============================================================ */
#part-generate-panel {
    margin-top: 12px;
}

#part-generate-panel select,
#part-generate-panel input[type="text"] {
    width: 100%;
    padding: 4px 6px;
    background: #0d0d1a;
    border: 1px solid #333;
    border-radius: 3px;
    color: #ddd;
    font-size: 12px;
    box-sizing: border-box;
}

#part-generate-panel button {
    width: 100%;
    padding: 6px 12px;
    background: #4a2d6a;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

#part-generate-panel button:hover {
    background: #5a3d7a;
}

#part-generate-panel button:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

#part-status-text {
    font-size: 10px;
    color: #888;
    margin-top: 4px;
    min-height: 16px;
}

#part-preview-container {
    display: none;
    margin-top: 6px;
    background: #0d0d1a;
    border-radius: 3px;
    border: 1px solid #222;
    overflow: hidden;
}

#part-preview-canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #1a1a2e;
}

/* ============================================================ */
/* ポーズ生成ダイアログ */
/* ============================================================ */
#pose-input-text {
    width: 100%;
    padding: 8px;
    background: #0d0d1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #eee;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

#pose-input-text:focus {
    outline: none;
    border-color: #4a6daa;
}

#pose-status-text {
    font-size: 12px;
    color: #888;
    min-height: 20px;
}

#pose-preview-canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #0d0d1a;
}

/* ============================================================ */
/* 写真アップロード */
/* ============================================================ */
#photo-preview-container {
    display: none;
    margin-top: 8px;
    padding: 8px;
    background: #1a1a2e;
    border-radius: 4px;
    border: 1px solid #333;
}

#photo-preview-image {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    object-fit: contain;
    background: #111;
}

#photo-status-text {
    font-size: 11px;
    color: #aaa;
}

/* ============================================================ */
/* ★ チケットセクション（新規追加） */
/* ============================================================ */
#ticketSection {
    background: #1a1a2e;
    border-radius: 12px;
    border: 1px solid #2a2a4a;
    padding: 18px 22px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#ticketSection .ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

#ticketSection .ticket-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-status {
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.ticket-status.active {
    background: #1a3a1a;
    color: #66dd88;
    border: 1px solid #2d6a3d;
}

.ticket-status.inactive {
    background: #3a1a1a;
    color: #ff8888;
    border: 1px solid #6a2d2d;
}

.ticket-status.expiring {
    background: #3a3a1a;
    color: #ffdd66;
    border: 1px solid #6a6a2d;
}

.ticket-status.expired {
    background: #3a1a1a;
    color: #ff8888;
    border: 1px solid #6a2d2d;
}

.ticket-status.development {
    background: #1a2a3a;
    color: #66aaff;
    border: 1px solid #2d4a6a;
}

.ticket-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ticket-buttons .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-ticket-buy {
    background: #27ae60;
    color: #fff;
}

.btn-ticket-buy:hover {
    background: #1e8449;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-ticket-activate {
    background: #4a90d9;
    color: #fff;
}

.btn-ticket-activate:hover:not(:disabled) {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.btn-ticket-activate:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.ticket-info {
    padding: 12px 16px;
    background: #0d0d1a;
    border-radius: 8px;
    font-size: 13px;
    color: #aaa;
    line-height: 1.6;
    border-left: 3px solid #e67e22;
}

/* ============================================================ */
/* ユーティリティ */
/* ============================================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #666;
}

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }

/* ============================================================ */
/* レスポンシブ */
/* ============================================================ */
@media (max-width: 1024px) {
    #col1 { width: 130px; }
    #col2 { width: 130px; }
    #col4 { width: 160px; }
}

@media (max-width: 768px) {
    #col1 { width: 100px; }
    #col2 { width: 110px; }
    #col4 { width: 140px; }

    .ticket-buttons {
        flex-direction: column;
    }

    .ticket-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    #ticketSection .ticket-header {
        flex-direction: column;
        align-items: stretch;
    }
}
