@charset "UTF-8";

/* =========================================
   WRC造 一括検定シミュレータ (wrc_simulator.css)
   アーキトレンド共通デザインシステム (common.css) 準拠
========================================= */

/* --- 全体レイアウト --- */
.wrc-app-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 120px);
    margin-top: 15px;
}

.wrc-left-panel {
    flex: 0.85;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 520px;
}

.wrc-right-panel {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 1024px) {
    .wrc-app-container {
        flex-direction: column;
    }
    .wrc-left-panel {
        min-height: 380px;
    }
}

/* --- ヘッダー操作バー（APIキー・モデル選択・PDF出力） --- */
.wrc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.wrc-toolbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wrc-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.wrc-input-key {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    width: 180px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}
.wrc-input-key:focus {
    border-color: var(--accent);
}

.wrc-select-model {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    width: 170px;
    font-size: 0.85rem;
    background: #ffffff;
    outline: none;
}

/* --- アップロードゾーン --- */
.wrc-upload-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed #94a3b8;
    margin: 20px;
    border-radius: var(--radius-md);
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    padding: 20px;
}
.wrc-upload-zone:hover {
    background: #e2e8f0;
    border-color: var(--accent);
}

.wrc-loader-container {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.wrc-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: wrc-spin 1s linear infinite;
    margin-bottom: 15px;
}
@keyframes wrc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wrc-image-viewer {
    display: none;
    flex: 1;
    position: relative;
    overflow: auto;
    padding: 12px;
}
.wrc-image-viewer img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* --- 梁ナビゲーションバー --- */
.wrc-nav-bar {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wrc-nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.wrc-nav-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
}

.wrc-progress-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.wrc-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #94a3b8;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: all 0.25s ease;
    cursor: pointer;
}
.wrc-dot.active {
    transform: scale(1.35);
    border-color: var(--primary);
}
.wrc-dot.ok { background: var(--success); }
.wrc-dot.ng { background: var(--danger); }

/* --- 構造設計の罠 警告パネル --- */
.wrc-trap-alert {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 5px solid #f97316;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.wrc-trap-title {
    font-weight: 700;
    color: #c2410c;
    margin-bottom: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wrc-trap-desc {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
}
.wrc-trap-desc ol {
    margin: 5px 0 8px;
    padding-left: 20px;
}
.wrc-trap-desc li {
    margin-bottom: 4px;
}

/* --- AIエージェント対話メッセージ --- */
.wrc-agent-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
}
.wrc-agent-msg {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.wrc-agent-icon {
    width: 42px;
    height: 42px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.wrc-agent-text {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 10px;
    border-top-left-radius: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    width: 100%;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    transition: opacity 0.2s;
}

/* --- 入力カードパネル --- */
.wrc-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}
.wrc-card-header {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wrc-setup-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.wrc-setup-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.wrc-setup-item label {
    font-weight: 600;
    color: #475569;
    font-size: 0.88rem;
}
.wrc-setup-item input, .wrc-setup-item select {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    text-align: right;
}

.wrc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 680px) {
    .wrc-grid-2 { grid-template-columns: 1fr; }
}

.wrc-rebar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    background: #f8fafc;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid #f1f5f9;
}
.wrc-rebar-row label {
    width: 48px;
    font-weight: 600;
    font-size: 0.88rem;
    color: #475569;
}
.wrc-rebar-row input[type="number"] {
    width: 52px;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    text-align: right;
    font-size: 0.92rem;
}
.wrc-rebar-row select {
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
}

.wrc-clearance-box {
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    margin-top: 8px;
    border: 1px solid transparent;
}
.wrc-clearance-ok {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}
.wrc-clearance-ng {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* --- 3列ダッシュボード --- */
.wrc-dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 860px) {
    .wrc-dash-grid-3 { grid-template-columns: 1fr; }
}

.wrc-sub-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px;
}
.wrc-sub-header {
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 6px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1rem;
}

.wrc-result-group {
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.wrc-result-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.wrc-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #334155;
}
.wrc-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-top: 3px;
    color: #475569;
}

.wrc-status-badge {
    padding: 2px 7px;
    border-radius: 12px;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
}
.wrc-bg-ok { background: var(--success); }
.wrc-bg-ng { background: var(--danger); }
.wrc-bg-none { background: #94a3b8; }

.wrc-bar-wrap {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 2px;
}
.wrc-bar-fill {
    height: 100%;
    transition: 0.3s ease-out;
}
.wrc-bar-target {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: #0f172a;
    z-index: 10;
}

.wrc-limit-alert {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--danger);
    background: #fee2e2;
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 4px;
    display: none;
    text-align: center;
}
.wrc-meta-text {
    font-size: 0.68rem;
    color: #64748b;
    text-align: right;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* --- モーダルスタイル --- */
.wrc-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.wrc-modal-content {
    background: white;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-md);
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.wrc-modal-close {
    position: absolute;
    top: 14px; right: 18px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    line-height: 1;
}
.wrc-modal-close:hover { color: #0f172a; }

.wrc-modal-body h2 {
    font-size: 1.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-top: 0;
    color: var(--primary);
}
.wrc-modal-body h3 {
    font-size: 1.05rem;
    color: #1e293b;
    margin-top: 22px;
    margin-bottom: 8px;
}
.wrc-modal-body p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #334155;
    margin-bottom: 10px;
}
.wrc-modal-body ul, .wrc-modal-body ol {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.65;
    padding-left: 20px;
    margin-bottom: 14px;
}
.wrc-modal-body li { margin-bottom: 5px; }
.wrc-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 18px;
    font-size: 0.85rem;
}
.wrc-modal-body th, .wrc-modal-body td {
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    text-align: left;
}
.wrc-modal-body th {
    background-color: #f1f5f9;
    font-weight: 700;
    color: var(--primary);
}

/* =========================================
   印刷用スタイル (@media print)
========================================= */
#print_area {
    display: none;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 9pt !important;
    }
    
    .no-print,
    .wrc-toolbar,
    .wrc-app-container,
    .wrc-trap-alert,
    .wrc-agent-container,
    header,
    #global-header-container,
    .global-header-nav,
    .global-header-inputs {
        display: none !important;
    }

    #print_area {
        display: block !important;
        padding: 0;
        margin: 0;
    }

    @page {
        size: A4 portrait;
        margin: 12mm 15mm;
    }

    .wrc-print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 15px;
        margin-bottom: 25px;
        font-size: 8.5pt;
    }

    .wrc-print-table th,
    .wrc-print-table td {
        border: 1px solid #000000;
        padding: 6px 8px;
        text-align: center;
        vertical-align: middle;
    }

    .wrc-print-table th {
        background-color: #f1f5f9 !important;
        font-weight: 700;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .wrc-print-badge {
        display: inline-block;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 700;
        font-size: 8pt;
    }
    .wrc-print-ok {
        border: 1.5px solid #10b981;
        color: #10b981;
    }
    .wrc-print-ng {
        border: 1.5px solid #ef4444;
        color: #ef4444;
    }

    .wrc-print-watermark {
        text-align: right;
        font-size: 8pt;
        color: #666666;
        margin-top: 20px;
    }
}
