/* 損益分岐点計算ツール スタイルシート */

/* コンテナ */
.bec-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.bec-calculator-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 3px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 入力セクション */
.bec-input-section {
    background: #ffffff;
    border-radius: 17px;
    padding: 30px;
}

.bec-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bec-input-group {
    margin-bottom: 20px;
}

.bec-label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

.bec-help-text {
    color: #999;
    font-size: 12px;
    font-weight: 400;
    margin-left: 5px;
}

.bec-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.bec-input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.bec-input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bec-unit {
    position: absolute;
    right: 15px;
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

/* 計算ボタン */
.bec-calculate-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.bec-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.bec-calculate-btn:active {
    transform: translateY(0);
}

.bec-btn-icon {
    font-size: 20px;
}

/* 結果表示セクション */
.bec-results-section {
    background: #ffffff;
    border-radius: 17px;
    padding: 30px;
    margin-top: 3px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* メイン結果 */
.bec-main-result {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 15px;
    margin-bottom: 30px;
}

.bec-result-label {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 600;
}

.bec-result-value {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.bec-number {
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.bec-unit-large {
    font-size: 24px;
    opacity: 0.8;
}

.bec-result-message {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

/* サブ結果 */
.bec-sub-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.bec-sub-result-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}

.bec-sub-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.bec-sub-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

/* ビジュアルセクション */
.bec-visual-section {
    margin-top: 30px;
}

/* ゲージ */
.bec-gauge-container {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.bec-gauge-title {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    font-weight: 600;
}

.bec-gauge-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto 15px;
}

.bec-gauge-bg {
    height: 40px;
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid #d1d5db;
}

.bec-gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    border-radius: 20px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1), 
                background 0.5s ease,
                box-shadow 0.5s ease;
}

.bec-gauge-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    color: #333;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.5s ease;
    white-space: nowrap;
    z-index: 10;
    padding: 2px 8px;
    border-radius: 4px;
}

.bec-gauge-legend {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 0 auto;
    font-size: 12px;
}

.bec-legend-loss {
    color: #dc2626;
    font-weight: 600;
}

.bec-legend-breakeven {
    color: #f59e0b;
    font-weight: 600;
}

.bec-legend-profit {
    color: #16a34a;
    font-weight: 600;
}

/* チャート */
.bec-chart-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    position: relative;
    height: 400px;
}

#bec-chart {
    max-height: 100%;
}

/* エラーメッセージ */
.bec-error {
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c00;
    margin-top: 20px;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .bec-container {
        margin: 20px auto;
    }
    
    .bec-input-section,
    .bec-results-section {
        padding: 20px;
    }
    
    .bec-title {
        font-size: 20px;
    }
    
    .bec-result-value {
        font-size: 36px;
    }
    
    .bec-sub-results {
        grid-template-columns: 1fr;
    }
    
    .bec-chart-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .bec-input-section,
    .bec-results-section {
        padding: 15px;
    }
    
    .bec-result-value {
        font-size: 28px;
    }
    
    .bec-unit-large {
        font-size: 18px;
    }
    
    .bec-sub-value {
        font-size: 20px;
    }
}