/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* メインコンテンツ */
main {
    padding: 40px 30px;
}

/* 入力セクション */
.input-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

.input-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* ボタン */
.button-container {
    text-align: center;
    margin: 30px 0;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

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

/* 結果セクション */
.result-section {
    margin-top: 40px;
}

.result-section h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

/* サマリーカード */
.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-card.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.summary-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.summary-card p {
    font-size: 1rem;
    margin: 8px 0;
}

.summary-card span {
    font-weight: 700;
    font-size: 1.2rem;
}

/* グラフコンテナ */
.chart-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

.chart-container h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* テーブル */
.table-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
}

.table-container h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.table-scroll {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th {
    padding: 15px;
    text-align: center;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

tbody td {
    padding: 12px 15px;
    text-align: right;
}

tbody td:first-child {
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

/* フッター */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
}

/* レスポンシブ */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px 15px;
    }

    .input-section {
        padding: 20px;
    }

    .summary {
        grid-template-columns: 1fr;
    }

    .calculate-btn {
        padding: 12px 40px;
        font-size: 1rem;
    }

    table {
        font-size: 0.9rem;
    }

    thead th,
    tbody td {
        padding: 10px 8px;
    }
}
