/* ==========================================
   共通変数・テーマ設定
   ========================================== */
:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --primary-color: #4dadf7;
    --secondary-color: #adb5bd;
    --success-color: #2b8a3e;
    --border-color: #dee2e6;
    --toast-bg: #343a40;
    --toast-text: #ffffff;
}

[data-theme="dark"] {
    --bg-color: #1a1b1e;
    --card-bg: #25262b;
    --text-color: #c1c2c5;
    --primary-color: #1c7ed6;
    --secondary-color: #495057;
    --success-color: #234e2c;
    --border-color: #373a40;
    --toast-bg: #f8f9fa;
    --toast-text: #212529;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* ==========================================
   ヘッダー・コンポーネント
   ========================================== */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ボタン */
button, .btn-secondary, .btn-success, .btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-secondary { background-color: var(--secondary-color); color: var(--text-color); }
.btn-success { background-color: var(--success-color); color: white; }
button:hover { opacity: 0.9; }

/* フォーム要素 */
input[type="text"], select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--card-bg);
    color: var(--text-color);
    margin-bottom: 10px;
}

/* ==========================================
   レイアウト（グリッド・カード）
   ========================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0,0,0,0.03);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.06); }
.card-icon { font-size: 2rem; margin-bottom: 10px; }

/* ==========================================
   共通ギミック（共通レイアウト・ドロップ領域）
   ========================================== */
.view { animation: fadeIn 0.3s ease; }
.hidden { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropzone {
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: var(--card-bg);
    cursor: pointer;
    margin: 20px 0;
}
.dropzone.dragover { background-color: rgba(77, 173, 247, 0.1); }

.result-box {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.control-panel {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 15px 0;
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 10px;
    background-color: var(--card-bg);
    margin: 10px 0;
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--toast-bg);
    color: var(--toast-text);
    padding: 12px 24px;
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ==========================================
   お知らせポップアップ（モーダル）
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0 5px;
}
.modal-close-btn:hover { color: var(--text-color); }

.modal-body {
    max-height: 350px;
    overflow-y: auto;
}

.news-item { margin-bottom: 15px; }
.news-date { font-size: 0.85rem; color: var(--secondary-color); font-weight: bold; }
.news-badge { background-color: #ff922b; color: white; font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; margin-left: 5px; font-weight: bold;}
.news-item h4 { margin: 5px 0; color: var(--primary-color); }
.news-item p { font-size: 0.9rem; line-height: 1.4; }
.news-item.latest { background: rgba(77, 173, 247, 0.05); padding: 10px; border-radius: 6px; }

/* ==========================================
   固有ツール用スタイル
   ========================================== */
.thumb-preview-container img { max-width: 100%; height: auto; border-radius: 6px; margin-bottom: 15px;}
.roulette-layout { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px;}
.roulette-setup, .roulette-display { flex: 1; min-width: 280px; text-align: center;}
.result-badge { font-size: 1.5rem; font-weight: bold; margin-top: 15px; color: var(--primary-color); }
#qrcode-output { display: flex; justify-content: center; margin: 20px 0; }
