/* =========================================================
   ShelfMind - Global Styles
   ---------------------------------------------------------
   ・全ページ共通デザイン
   ・フォーム / カード / レイアウト / 見出し
   ・Home / add-book / confirm-book 全対応
========================================================= */

/* ---------------------
   全体設定
---------------------- */
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f5f7fa;
    color: #212121;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------------------
   ヘッダー
---------------------- */
header {
    height: 120px;
    background: #ffffff;
    padding: 24px 40px;
    border-bottom: 1px solid #e0e0e0;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    margin: 0;
    font-size: 26px;
    color: #1a73e8;
}

.subtitle {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #616161;
}

.clock {
    font-size: 18px;
    color: #333333;
}

/* ---------------------
   メイン領域
---------------------- */
main {
    flex: 1;
    overflow-y: auto;
    padding: 24px 40px;
}

/* ---------------------
   セクションタイトル
---------------------- */
.group h2 {
    font-size: 20px;
    color: #424242;
    margin-bottom: 12px;
}

/* ---------------------
   Home：カードグリッド
---------------------- */
.cards {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.card {
    width: 280px;
    height: 130px;
    background: #ffffff;
    border-radius: 12px;
    padding: 18px;
    text-decoration: none;
    color: #212121;
    border: 1px solid #e0e0e0;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    transition: 0.2s ease;
}

.card-title {
    font-size: 18px;
    color: #1a73e8;
    font-weight: 600;
}

.card-desc {
    font-size: 14px;
    color: #616161;
    line-height: 1.4;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* ---------------------
   フッター
---------------------- */
footer {
    height: 45px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    line-height: 45px;
    color: #757575;
}

footer a {
    color: #1a73e8;
    text-decoration: none;
}

/* =========================================================
   ▼ フォーム共通デザイン
========================================================= */
.form-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);

    display: flex;
    flex-direction: column;
    gap: 18px;

    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    color: #424242;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    outline: none;
    background: #fafafa;
}

.form-group textarea {
    resize: vertical;
}

/* ---------------------
   ボタン
---------------------- */
.btn {
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    background: #f1f3f4;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: 0.12s ease;
}

.btn:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background: #1669c1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =========================================================
   ▼ add-book 専用レイアウト
========================================================= */
.add-book-container {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.form-left {
    flex: 1.2;
}

.preview-right {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-right img {
    width: 220px;
    height: auto;
    border-radius: 6px;
    margin-bottom: 14px;
    border: 1px solid #ddd;
}

.preview-info {
    width: 100%;
    font-size: 14px;
}

.preview-info div {
    margin-bottom: 8px;
}

/* =========================================================
   ▼ confirm-book 専用レイアウト
========================================================= */
#confirmCard {
    max-width: 600px;
    margin: 0 auto;

    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);

    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
    padding: 6px 0;
}

.confirm-row:last-child {
    border-bottom: none;
}

.confirm-row .label {
    font-weight: 600;
    color: #424242;
}

.confirm-row .value {
    max-width: 65%;
    text-align: right;
    color: #212121;
}

/* =========================================================
   ▼ 汎用：中央寄せ
========================================================= */
.center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* =========================================================
   ▼ レスポンシブ対応
========================================================= */
@media (max-width: 768px) {
    .add-book-container {
        flex-direction: column;
    }
    .preview-right {
        align-items: center;
        margin-top: 16px;
    }
    .cards {
        flex-direction: column;
        align-items: center;
    }
}
