/* モーダル共通スタイル */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(52, 152, 219, 0.3);
    color: #ecf0f1;
}

.modal-content.modal-wide {
    max-width: 800px;
}

.modal-content h2 {
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    text-align: center;
}

.modal-subtitle {
    text-align: center;
    color: #bdc3c7;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* 人口増加モーダル */
#population-change-details {
    background: rgba(46, 204, 113, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(46, 204, 113, 0.3);
}

#population-change-details p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

#population-change-details .population-number {
    color: #2ecc71;
    font-weight: bold;
    font-size: 1.3rem;
}

#population-change-details .growth-rate {
    color: #3498db;
    font-weight: bold;
}

/* 投資選択モーダル */
#investment-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.investment-option {
    background: linear-gradient(135deg, rgba(52, 109, 164, 0.9) 0%, rgba(44, 82, 130, 0.9) 100%);
    padding: 1.2rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.investment-option:hover {
    border-color: rgba(52, 152, 219, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.investment-option.selected {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9) 0%, rgba(39, 174, 96, 0.9) 100%);
    border-color: #2ecc71;
}

.investment-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.investment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.investment-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ecf0f1;
}

.investment-cost {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #f39c12;
}

.investment-description {
    color: #bdc3c7;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.investment-effects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.investment-effect {
    background: rgba(52, 152, 219, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

/* モーダルボタン */
.modal-content button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

#btn-close-population-modal {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

#btn-close-population-modal:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

#btn-close-investment-modal {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
}

#btn-close-investment-modal:hover {
    background: linear-gradient(135deg, #95a5a6 0%, #bdc3c7 100%);
}

/* 取引成立モーダル */
#trade-success-modal .modal-content {
    max-width: 800px;
}

.trade-summary {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
}

.trade-side {
    flex: 1;
    background: rgba(52, 73, 94, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(52, 152, 219, 0.3);
}

.trade-side h3 {
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
    white-space: nowrap;
}

.trade-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trade-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.trade-item-name {
    color: #ecf0f1;
    font-size: 1rem;
}

.trade-item-amount {
    color: #2ecc71;
    font-weight: bold;
    font-size: 1.1rem;
}

.trade-arrow {
    font-size: 2rem;
    color: #f39c12;
}

#btn-close-trade-success {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

#btn-close-trade-success:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* 加工モーダル */
.production-option {
    background: linear-gradient(135deg, rgba(52, 109, 164, 0.9) 0%, rgba(44, 82, 130, 0.9) 100%);
    padding: 1.2rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

.production-option:hover {
    border-color: rgba(52, 152, 219, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.production-option.selected {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9) 0%, rgba(39, 174, 96, 0.9) 100%);
    border-color: #2ecc71;
}

.production-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.production-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.production-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ecf0f1;
}

.production-cost {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #f39c12;
}

.production-description {
    color: #bdc3c7;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.production-outputs {
    color: #2ecc71;
    font-size: 0.95rem;
    font-weight: bold;
}
