/* =========================
   全体設定
========================= */

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    font-family: "Yu Gothic", sans-serif;
    line-height: 1.8;
    background: #f5f7fa;
    color: #333;
    transition: 0.3s;
}

/* =========================
   ダークモード
========================= */

body.dark{
    background: #121212;
    color: #f5f5f5;
}

body.dark section{
    background: #1e1e1e;
}

body.dark .card{
    background: #2b2b2b;
}

body.dark table{
    background: #2b2b2b;
}

body.dark input{
    background: #333;
    color: white;
    border: 1px solid #666;
}

/* =========================
   ダークモードボタン
========================= */

#darkModeBtn{
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 999;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #1976d2;
    color: white;
    font-weight: bold;
}

#darkModeBtn:hover{
    opacity: 0.9;
}

/* =========================
   ヘッダー
========================= */

header{
    background: linear-gradient(
        135deg,
        #1976d2,
        #42a5f5
    );
    color: white;
    text-align: center;
    padding: 60px 20px;
}

header h1{
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p{
    font-size: 1.1rem;
}

/* =========================
   セクション
========================= */

section{
    background: white;
    margin: 30px auto;
    width: 90%;
    max-width: 1200px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

section h2{
    margin-bottom: 20px;
    color: #1976d2;
}

/* =========================
   スライダー
========================= */

.slider{
    text-align: center;
}

#sliderImage{
    width: 250px;
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    transition: 0.5s;
}

#sliderText{
    font-size: 1.8rem;
}

/* =========================
   フォーム
========================= */

input[type="text"],
input[type="number"]{
    width: 100%;
    max-width: 400px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

label{
    display: block;
    margin-bottom: 10px;
}

/* =========================
   ボタン
========================= */

button{
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #1976d2;
    color: white;
    font-weight: bold;
    transition: 0.3s;
}

button:hover{
    background: #1258a7;
    transform: translateY(-2px);
}

/* =========================
   メーカーカード
========================= */

.card-container{
    display: grid;
    grid-template-columns:
        repeat(auto-fit,minmax(250px,1fr));
    gap: 20px;
}

.card{
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid #ddd;
}

.card:hover{
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.card img{
    width: 120px;
    height: auto;
    margin-bottom: 15px;
}

.card h3{
    margin-bottom: 10px;
}

.card p{
    margin-bottom: 15px;
}

.card button{
    width: 100%;
}

/* =========================
   メーカー詳細
========================= */

#makerDetail{
    margin-top: 30px;
    padding: 20px;
    border-radius: 10px;
    background: #f1f8ff;
}

body.dark #makerDetail{
    background: #2a3a4a;
}

/* =========================
   比較表
========================= */

.comparison-table{
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.comparison-table th,
.comparison-table td{
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
}

.comparison-table th{
    background: #1976d2;
    color: white;
}

.comparison-table tr:nth-child(even){
    background: #f7f7f7;
}

body.dark .comparison-table tr:nth-child(even){
    background: #333;
}

/* =========================
   ランキング結果
========================= */

#rankingResult{
    margin-top: 20px;
    padding: 20px;
    background: #f1f8ff;
    border-radius: 10px;
}

body.dark #rankingResult{
    background: #2a3a4a;
}

/* =========================
   診断結果
========================= */

#diagnosisResult,
#zeroResult,
#tatamiResult,
#searchResult{
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #f1f8ff;
}

body.dark #diagnosisResult,
body.dark #zeroResult,
body.dark #tatamiResult,
body.dark #searchResult{
    background: #2a3a4a;
}

/* =========================
   フェードインアニメーション
========================= */

.fade{
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s;
}

.fade.show{
    opacity: 1;
    transform: translateY(0);
}

/* =========================
   フッター
========================= */

footer{
    text-align: center;
    padding: 30px;
    margin-top: 30px;
    background: #1976d2;
    color: white;
}

/* =========================
   レスポンシブ
========================= */

@media(max-width:768px){

    header h1{
        font-size: 2rem;
    }

    section{
        width: 95%;
        padding: 20px;
    }

    .comparison-table{
        font-size: 0.85rem;
    }

    button{
        width: 100%;
        margin-top: 10px;
    }
}