/* 射出成型遊戲樣式 */

.game-container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 20px 40px;
    background: #f5f5f5;
    min-height: 100vh;
}

.game-main {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    color: #2A2E33;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.game-subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* 進度條 */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    padding: 0 10px;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #ddd;
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s;
}

.progress-step.active .step-number {
    background: #e67e22;
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: #27ae60;
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    max-width: 80px;
}

.progress-step.active .step-label {
    color: #e67e22;
    font-weight: bold;
}

/* 遊戲畫面 */
.game-screen {
    min-height: 500px;
}

.game-step {
    display: none;
    animation: fadeIn 0.5s;
}

.game-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-step h2 {
    color: #2A2E33;
    font-size: 2rem;
    margin-bottom: 10px;
}

.step-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* 產品選擇卡片 */
.product-selection,
.decision-cards,
.mold-options,
.material-options,
.resin-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card,
.decision-card,
.mold-card,
.material-card,
.resin-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.product-card:hover,
.decision-card:hover,
.mold-card:hover,
.material-card:hover,
.resin-card:hover {
    border-color: #e67e22;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(230, 126, 34, 0.2);
}

.product-card.selected,
.decision-card.selected,
.mold-card.selected,
.material-card.selected,
.resin-card.selected {
    border-color: #e67e22;
    background: #fff5ee;
}

.product-icon,
.decision-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.product-card h3,
.decision-card h3,
.mold-card h3,
.material-card h3,
.resin-card h3 {
    color: #2A2E33;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.difficulty {
    color: #e67e22;
    font-weight: bold;
    margin-bottom: 10px;
}

.description,
.recommendation,
.application {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 決策卡片統計 */
.decision-stats,
.mold-stats,
.material-stats,
.resin-stats {
    margin: 15px 0;
    text-align: left;
}

.decision-stats p,
.mold-stats p,
.material-stats p,
.resin-stats p {
    margin: 8px 0;
    font-size: 0.95rem;
}

.cost {
    color: #e74c3c;
}

.time {
    color: #3498db;
}

.benefit,
.quality {
    color: #27ae60;
}

.risk {
    color: #e67e22;
}

/* 設計視圖 */
.design-view,
.inspection-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.3d-preview,
.product-preview {
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    text-align: center;
}

.rotating-product,
.sample-product {
    font-size: 6rem;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

.preview-placeholder p {
    color: #999;
    margin-top: 20px;
    font-size: 1.1rem;
}

.design-info,
.inspection-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 信息框 */
.info-box {
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    background: #f0f8ff;
}

.info-box.warning {
    border-left-color: #e67e22;
    background: #fff5ee;
}

.info-box.success {
    border-left-color: #27ae60;
    background: #f0fff4;
}

.info-box strong {
    display: block;
    margin-bottom: 10px;
    color: #2A2E33;
    font-size: 1.1rem;
}

.info-box p {
    color: #666;
    line-height: 1.6;
}

/* 按鈕 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #e67e22;
    color: white;
}

.btn-primary:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.decision-buttons {
    display: flex;
    gap: 15px;
}

.decision-buttons .btn {
    flex: 1;
}

/* 製造動畫 */
.manufacturing-animation {
    margin-top: 30px;
}

.animation-container {
    text-align: center;
    margin-bottom: 30px;
}

.machine-icon {
    font-size: 5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.progress-animation {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e67e22, #f39c12);
    width: 0%;
    transition: width 0.5s;
    border-radius: 15px;
}

.animation-text {
    color: #666;
    font-size: 1.2rem;
    font-weight: bold;
}

.manufacturing-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stage {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    color: #999;
}

.stage.active {
    background: #fff5ee;
    color: #e67e22;
}

.stage.completed {
    background: #f0fff4;
    color: #27ae60;
}

/* 最終報告 */
.final-report {
    display: grid;
    gap: 30px;
}

.report-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
}

.report-section h3 {
    color: #2A2E33;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table tr {
    border-bottom: 1px solid #ddd;
}

.report-table td {
    padding: 12px;
    color: #666;
}

.report-table .total-row {
    border-top: 2px solid #2A2E33;
    font-size: 1.2rem;
}

.report-table .total-row td {
    color: #2A2E33;
    padding-top: 15px;
}

/* 評分系統 */
.performance-score {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-label {
    min-width: 100px;
    font-weight: bold;
    color: #2A2E33;
}

.score-bar {
    flex: 1;
    height: 25px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 12px;
    transition: width 1s ease;
}

.final-grade {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: #e67e22;
    margin-top: 20px;
}

.product-info {
    margin-top: 20px;
    padding: 15px;
    background: #fff5ee;
    border-radius: 8px;
    border-left: 4px solid #e67e22;
}

.product-info p {
    margin: 8px 0;
    color: #2A2E33;
    font-size: 1.1rem;
}

.product-info span {
    margin-left: 10px;
    font-weight: bold;
    color: #e67e22;
}

.report-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* 歷史記錄 */
.game-sidebar {
    width: 300px;
    background: #2A2E33;
    color: #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 80px;
}

.game-sidebar h3 {
    color: #e67e22;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.log-console {
    background: #1a1d21;
    border-radius: 4px;
    padding: 15px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.log-entry {
    margin-bottom: 10px;
    padding: 8px;
    border-left: 3px solid #e67e22;
    background: rgba(230, 126, 34, 0.1);
    color: #ecf0f1;
    line-height: 1.5;
}

.log-entry.info {
    border-left-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.log-entry.success {
    border-left-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.log-entry.warning {
    border-left-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.log-entry.error {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .game-container {
        flex-direction: column;
    }

    .game-sidebar {
        width: 100%;
        max-height: 300px;
        position: static;
    }

    .progress-bar {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 30px;
    }

    .step-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 60px 10px 20px;
    }

    .game-main {
        padding: 20px;
    }

    .game-header h1 {
        font-size: 1.8rem;
    }

    .game-subtitle {
        font-size: 0.95rem;
    }

    .product-selection,
    .decision-cards,
    .mold-options,
    .material-options,
    .resin-options {
        grid-template-columns: 1fr;
    }

    .design-view,
    .inspection-view {
        grid-template-columns: 1fr;
    }

    .decision-buttons {
        flex-direction: column;
    }

    .manufacturing-stages {
        grid-template-columns: 1fr 1fr;
    }

    .report-actions {
        flex-direction: column;
    }

    .report-actions .btn {
        width: 100%;
    }

    .progress-step {
        min-width: 60px;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* 滾動條樣式 */
.log-console::-webkit-scrollbar {
    width: 8px;
}

.log-console::-webkit-scrollbar-track {
    background: #2A2E33;
}

.log-console::-webkit-scrollbar-thumb {
    background: #e67e22;
    border-radius: 4px;
}

.log-console::-webkit-scrollbar-thumb:hover {
    background: #d35400;
}

/* 模具配置樣式 */
.config-summary {
    background: #f0f8ff;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.config-summary h3 {
    color: #2A2E33;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.summary-item {
    background: white;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 3px solid #e67e22;
}

.summary-item strong {
    color: #2A2E33;
    display: inline-block;
    min-width: 90px;
}

.summary-item span {
    color: #e67e22;
    font-weight: bold;
}

.final-cost-display {
    background: #fff5ee;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    border: 2px dashed #e67e22;
}

.final-cost-display strong {
    color: #2A2E33;
}

.final-cost-display span {
    color: #e67e22;
    font-weight: bold;
    font-size: 1.3rem;
}

.config-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #e67e22;
}

.config-section h3 {
    color: #2A2E33;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.section-desc {
    color: #666;
    margin-bottom: 20px;
    font-size: 1rem;
}

.config-confirm {
    text-align: center;
    margin-top: 30px;
}

.btn-large {
    font-size: 1.2rem;
    padding: 15px 40px;
}

.btn-large:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-large:disabled:hover {
    background: #95a5a6;
    transform: none;
    box-shadow: none;
}
