/* 全体のリセットと共通設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #f8f9fa;
    color: #333333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダーのデザイン */
.site-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 💡 追加：ヘッダー上部の小さいサイトロゴ。
   layouts/app.blade.php に style 属性で書いていたものをこちらへ移しました */
.site-logo-mini a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.site-logo-mini a:hover {
    color: #ffffff;
}

.header-container h1 {
    font-size: 2.5rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.header-container p {
    font-size: 1rem;
    opacity: 0.9;
}

/* メインコンテンツ・ツール一覧 */
.tool-list-section {
    margin-top: 30px;
}

.tool-list-section h2 {
    font-size: 1.5rem;
    color: #2a5298;
    margin-bottom: 20px;
    border-left: 5px solid #2a5298;
    padding-left: 10px;
}

/* グリッドレイアウト（カードを横並びにする） */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* ツールカードのデザイン */
.tool-card {
    background-color: #ffffff;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* マウスを乗せた時の動き */
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.tool-icon {
    font-size: 2rem;
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 10px;
    line-height: 1;
}

/* 💡 追加：アイコンの色。blade 側に style="color: #2a5298;" を9箇所書いていたものを
   CSS の役割としてこちらへ集約しました（色を変えたい時はここ1箇所だけ直せば済みます） */
.tool-icon i {
    color: #2a5298;
}

.tool-info h3 {
    font-size: 1.2rem;
    color: #1e3c72;
    margin-bottom: 6px;
}

.tool-info p {
    font-size: 0.9rem;
    color: #666666;
}

/* フッターのデザイン */
.site-footer {
    background-color: #222222;
    color: #aaaaaa;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    font-size: 0.85rem;
}

.footer-container p {
    margin-bottom: 10px;
}

.footer-nav a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.footer-nav a:hover {
    opacity: 1;
}

/* === パンくずリストのデザイン === */
.breadcrumbs-wrapper {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 0;
    margin-bottom: 20px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    font-size: 0.85rem;
    color: #666666;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

/* 階層の間の「＞」の記号 */
.breadcrumbs li:not(:last-child)::after {
    content: "＞";
    margin: 0 10px;
    color: #cccccc;
    font-size: 0.75rem;
}

.breadcrumbs a {
    color: #2a5298;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs li:last-child {
    color: #333333;
    font-weight: bold;
}

/* スマホ向けの微調整 */
@media (max-width: 600px) {
    .header-container h1 {
        font-size: 2rem;
    }
    .tool-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* === its-toolトップページ用追加（ボタン類） === */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #3498db;
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: background-color 0.2s;
    margin-top: 15px;
}
.btn:hover { background-color: #2980b9; }
.btn-green { background-color: #2ecc71; }
.btn-green:hover { background-color: #27ae60; }

/* === スマホ・タブレット向けレスポンシブ対応 === */
@media (max-width: 768px) {
    /* 全体の余白と文字サイズを調整 */
    .container {
        padding: 15px;
    }
    .site-header {
        padding: 30px 15px;
    }
    .header-container h1 {
        font-size: 2rem;
    }
    .header-container p {
        font-size: 0.9rem;
    }
    
    /* トップページのカードを縦長に整える */
    .tool-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .tool-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    /* 各ツールの横並びのボタンや入力欄を、スマホ幅いっぱいの縦並びに変更 */
    .btn-group, .controls, .file-input-group, .item-input-group {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    .btn, .btn-calc, .btn-clear-tool, .btn-add, .controls select {
        width: 100%;
    }
}

/* === 💡 擬似全画面（iPhone/iPad等でFullscreen APIが使えない場合のフォールバック） === */
.pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important; /* モバイルのアドレスバー高さを考慮 */
    max-width: none !important;
    margin: 0 !important;
    z-index: 99999 !important;
    overflow: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff; /* 独自背景を持つツール(時計等)ではそちらが優先されます */
}
/* 背面（body）のスクロールを固定 */
body.pseudo-fullscreen-lock { overflow: hidden !important; }
/* 戻るボタン（擬似全画面時のみ動的に表示） */
.pseudo-fullscreen-exit {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: calc(env(safe-area-inset-right, 0px) + 12px);
    z-index: 100000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: bold;
    color: #ffffff;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50px;
    cursor: pointer;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.pseudo-fullscreen-exit:active { background: rgba(15, 23, 42, 0.95); }

/* === 💡 全ツール共通：詳細オプション（アコーディオン） === */
/*
 * 各ツールの基本操作とは分け、たまにしか触らない設定をまとめて収納する箱です。
 * 全画面表示の対象要素の外側に置くことで、全画面時には自動的に隠れます。
 * ※ ポケットカルクは独立した .pc-options（/css/calculator/pocketcalc.css）を使用します。
 */
.tool-options {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    overflow: hidden;
}

/* 見出し行（クリックで開閉） */
.tool-options-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    background: #f8f9fa;
    border: none;
    border-bottom: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: bold;
    color: #2a5298;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.tool-options-toggle:hover { background: #eef2f9; }

/* 開いている時は見出しの下に区切り線を出す */
.tool-options.is-open .tool-options-toggle {
    border-bottom-color: #e9ecef;
}

.tool-options-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 開閉の矢印（開いている時は上向きに回転） */
.tool-options-arrow {
    font-size: 0.85rem;
    color: #6c757d;
    transition: transform 0.25s;
}

.tool-options.is-open .tool-options-arrow {
    transform: rotate(180deg);
}

/* 中身（各ツールのオプションが入る） */
.tool-options-inner {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 擬似全画面中は、背面に残るオプション箱を確実に隠す */
body.pseudo-fullscreen-lock .tool-options { display: none !important; }

/* === スマホ・タブレット対応 === */
@media (max-width: 768px) {
    .tool-options-toggle { padding: 12px 14px; font-size: 0.9rem; }
    .tool-options-inner  { padding: 14px; gap: 14px; }
}

/*
 * アコーディオンの中に入れた各ツールのパネルは、外側の箱と二重に見えてしまうため
 * 背景・影・余白を打ち消す（各ツールのCSSは変更せず、ここでまとめて調整）
 */
.tool-options-inner > .options-panel,
.tool-options-inner > .clock-settings-panel {
    background: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

/* アコーディオンの外に常に出しておくボタン（全画面表示など） */
.options-always {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}


/* ===== 共通パーツ：ON/OFFスイッチ（x-tool-switch） ===== */
/* 💡 追加：tool-switch.blade.php の <style> と style属性 をここへ移動（blade は構造のみを持つ） */
.tool-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f5;
}

.tool-switch-container .tool-switch-label {
    font-weight: bold;
    color: #444;
    font-size: 0.95rem;
}

/* スイッチの外見設定 */
.switch-ui { position: relative; display: inline-block; width: 44px; height: 22px; flex-shrink: 0; }
.switch-ui input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
/* 💡 変更：以前は input:checked（全ページのチェックボックスが対象）だったため、スイッチ内だけに限定した */
.switch-ui input:checked + .slider { background-color: #2a5298; }
.switch-ui input:checked + .slider:before { transform: translateX(22px); }

/* ===== 共通パーツ：保存・リセットボタン（x-tool-actions） ===== */
/* 💡 追加：tool-actions.blade.php の <style> と style属性 をここへ移動 */
.tool-actions-group {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-common-action {
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.btn-download {
    flex: 2;
    background-color: #2ecc71;
    color: #fff;
    border: none;
}

.btn-reset {
    flex: 1;
    background-color: #fff;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.btn-download:hover { background-color: #27ae60; }
.btn-reset:hover { background-color: #e74c3c; color: #fff; }

/* === スマホ・タブレット対応 === */
@media (max-width: 768px) {
    .tool-switch-container .tool-switch-label { font-size: 0.9rem; }
    .btn-common-action { font-size: 0.9rem; }
}

/* ===== 共通パーツ：お知らせ / アップデート情報（x-news） ===== */
/* 💡 追加：news.blade.php の style属性 をここへ移動（blade は構造のみを持つ） */
.news-section {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.news-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.news-title {
    font-size: 1.2rem;
    color: #1e3c72;
    margin: 0;
}

.news-more {
    font-size: 0.9rem;
    color: #3498db;
    text-decoration: none;
    white-space: nowrap;
}

.news-list {
    list-style: none;
    font-size: 0.95rem;
    line-height: 1.8;
    padding-left: 0;
    margin: 0;
}

.news-item { margin-bottom: 8px; }

.news-date {
    color: #2a5298;
    font-weight: bold;
    margin-right: 15px;
    display: inline-block;
    width: 90px;
}

.news-link { color: #555; text-decoration: none; }
.news-link:hover { text-decoration: underline; }

.news-badge {
    color: #e74c3c;
    font-weight: bold;
    font-size: 0.85rem;
    margin-right: 5px;
}

/* === スマホ・タブレット対応 === */
@media (max-width: 768px) {
    .news-section { padding: 18px; }
    .news-title { font-size: 1.05rem; }
    .news-list { font-size: 0.9rem; }
    .news-date {
        /* 幅固定だと日付とタイトルが重なるため、スマホでは日付を上段に出す */
        display: block;
        width: auto;
        margin-right: 0;
        font-size: 0.85rem;
    }
    .news-item { margin-bottom: 12px; }
}

/* ===== 共通パーツ：「トップページに戻る」リンク ===== */
/* 💡 追加：各 blade に同じ style属性 が10箇所コピーされていたため、ここに1つだけ定義した */
.back-btn {
    display: inline-block;
    margin-top: 30px;
    color: #2a5298;
    text-decoration: none;
}

.back-btn:hover { text-decoration: underline; }

/* ===== 共通パーツ：主要アクションのボタン ===== */
/* 💡 追加：単価計算ページと単価早見表ページで同じ見た目のボタンを使うため、
             それぞれの CSS に書かず、ここに1つだけ定義した */
.btn-primary {
    background: #2a5298;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover { background: #1e3c72; }
