/* common.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
}

/* アニメーション */
.fade-in {
    animation: fadeIn 0.3s ease-in forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}
@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

.hidden { display: none !important; }

/* 共通UIコンテナ（JavaScriptで中身を生成） */
#header-container {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

#header-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #ef4444; /* QcDaアプリトーン: Red/Orange系 */
    text-decoration: none;
    cursor: pointer;
}

/* ハンバーガーメニュー */
#hamburger-icon {
    width: 30px; height: 24px;
    display: flex; flex-direction: column; justify-content: space-between;
    cursor: pointer; z-index: 1000;
}
#hamburger-icon div {
    width: 100%; height: 3px; background-color: #374151;
    border-radius: 2px; transition: all 0.3s;
}
#hamburger-icon.open .bar1 { transform: rotate(45deg) translate(6px, 8px); }
#hamburger-icon.open .bar2 { opacity: 0; }
#hamburger-icon.open .bar3 { transform: rotate(-45deg) translate(6px, -8px); }

#side-menu {
    position: fixed; top: 0; right: -280px; width: 280px; height: 100%;
    background-color: #ffffff; box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease; z-index: 999; padding-top: 60px;
    overflow-y: auto;
}
#side-menu.open { right: 0; }

#menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); opacity: 0; visibility: hidden;
    transition: all 0.3s; z-index: 998;
}
#menu-overlay.open { opacity: 1; visibility: visible; }

.menu-link {
    display: block; padding: 15px 25px; color: #4b5563; font-weight: 500;
    text-decoration: none; border-bottom: 1px solid #f3f4f6; transition: background 0.2s;
}
.menu-link:hover { background-color: #f9fafb; color: #ef4444; }
.menu-sub-link {
    display: block; padding: 10px 25px 10px 40px; color: #9ca3af; font-size: 0.85em;
    text-decoration: none; transition: color 0.2s;
}
.menu-sub-link:hover { color: #ef4444; }
.menu-ver {
    display: block; padding: 20px 25px; color: #d1d5db; font-size: 0.8em;
}

/* フッター */
#footer-container {
    background-color: #1f2937;
    color: #9ca3af;
    text-align: center;
    padding: 20px 10px;
    font-size: 0.875rem;
    margin-top: auto;
}
#footer-container a { color: #d1d5db; text-decoration: underline; margin: 0 10px; }

/* ローディング */
#loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,0.8);
    display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 2000;
}
.spinner {
    width: 50px; height: 50px; border: 5px solid #f3f3f3;
    border-top: 5px solid #ef4444; border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 共通ボタン・カードスタイル（Tailwindベースを拡張） */
.btn {
    display: inline-block; width: 100%; padding: 12px; border-radius: 8px; font-weight: bold;
    text-align: center; cursor: pointer; transition: all 0.2s; border: none; outline: none;
}
.btn-primary { background-color: #ef4444; color: white; box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3); }
.btn-primary:hover { background-color: #dc2626; transform: translateY(-1px); }
.btn-primary:disabled { background-color: #fca5a5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background-color: #e5e7eb; color: #374151; }
.btn-secondary:hover { background-color: #d1d5db; }

.card {
    background: white; border-radius: 12px; padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); margin-bottom: 20px;
}

/* モーダル */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center; z-index: 1050;
    padding: 20px;
}
.modal-content {
    background: white; border-radius: 16px; padding: 24px; width: 100%; max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
