/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* メインコンテンツ */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

h3 {
    color: #555;
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem;
}

/* ツールコンテナ */
.tool-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.input-group input {
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* ボタン */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* エラーメッセージ */
.error-message {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #d32f2f;
    display: none;
}

.error-message.show {
    display: block;
}

/* 結果表示 */
.result-container {
    display: none;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.result-container.show {
    display: block;
}

.result-bmi {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2e7d32;
    margin: 1rem 0;
}

.result-status {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1b5e20;
    margin-bottom: 0.5rem;
}

.result-description {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
}

/* 使い方セクション */
.usage-section ol {
    padding-left: 1.5rem;
}

.usage-section li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

/* 情報セクション */
.info-section p {
    margin-bottom: 1rem;
    text-align: justify;
}

.info-table {
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background-color: #667eea;
    color: white;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

/* フッター */
footer {
    background-color: #333;
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 3rem;
}

.footer-nav {
    margin-bottom: 1rem;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: opacity 0.3s;
}

.footer-nav a:hover {
    opacity: 0.7;
}

.contact {
    margin: 1rem 0;
}

.contact a {
    color: #667eea;
    text-decoration: none;
}

.contact a:hover {
    text-decoration: underline;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1rem;
}

/* Cookieバナー */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #333;
    color: white;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.cookie-banner.show {
    display: block;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.cookie-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-cookie {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-cookie:hover {
    background-color: #5568d3;
}

/* レスポンシブデザイン */
@media (min-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .cookie-content {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .cookie-content p {
        flex: 1;
        margin-right: 1rem;
    }
}

@media (max-width: 767px) {
    section {
        padding: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .result-bmi {
        font-size: 2rem;
    }
    
    .result-status {
        font-size: 1.2rem;
    }
}