/* ==========================================================================
   共通設定
   ========================================================================== */
* { 
    box-sizing: border-box; 
}

body { 
    background: #e9ebee; 
    margin: 0; 
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif; 
    color: #2c3e50; 
    line-height: 1.6;
}

/* リンクの基本設定 */
a { 
    color: #d32f2f; 
    text-decoration: none; 
    transition: background 0.2s ease, color 0.2s ease; 
}

/* レイアウト構造 */
.container {
    max-width: 1140px;
    margin: 25px auto;
    padding: 0 15px;
    display: flex;
    gap: 25px;
}

@media (max-width: 992px) {
    .container {
        flex-direction: column;
        margin: 15px auto;
    }
    .sidebar {
        width: 100% !important;
    }
}

.main-content { 
    flex: 1; 
    min-width: 0; 
}

.sidebar { 
    width: 300px; 
    flex-shrink: 0; 
}

/* ==========================================================================
   ヘッダー & ドロップダウンメニュー
   ========================================================================== */
.user-menu-container {
    position: relative;
    padding-left: 15px;
    border-left: 1px solid #ddd;
}

.user-menu-trigger {
    font-size: 13px;
    color: #d32f2f;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 0;
    transition: 0.2s;
}

.user-menu-trigger:hover {
    opacity: 0.7;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    min-width: 180px;
    display: none; /* 初期非表示 */
    z-index: 1001;
}

.user-menu-container:hover .user-dropdown {
    display: block;
}

.user-dropdown li a {
    display: block;
    padding: 10px 15px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    font-weight: normal;
}

.user-dropdown li a:hover {
    background: #f8f9fa;
    color: #d32f2f;
}

.user-dropdown li.divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

/* ==========================================================================
   カードデザイン
   ========================================================================== */
.card {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header {
    color: #fff;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.card-header.hall { background: #d32f2f; }
.card-header.machine { background: #1976d2; }
.card-header.forum { background: #388e3c; }
.card-header.user { background: #2c3e50; }

.card-body { 
    padding: 15px 20px; 
    flex: 1; 
}

/* ==========================================================================
   掲示板関連（リスト・グリッド）
   ========================================================================== */
/* スレッド一覧などの行表示 */
.list-item {
    border-bottom: 1px solid #f0f0f0;
}
.list-item:last-child { border-bottom: none; }

.list-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    color: #333;
    width: 100%;
    transition: 0.2s;
}

.list-item a:hover {
    background: #f8f9fa;
    color: #d32f2f;
}

/* 4項目横並び用のグリッド */
.forum-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .forum-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 地域別リンク */
.region-link {
    font-size: 13px;
    color: #1976d2;
    text-decoration: none;
    padding: 2px 4px;
}
.region-link:hover {
    text-decoration: underline;
    background: #e3f2fd;
    border-radius: 2px;
}

/* ==========================================================================
   ボタン・UI要素
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s ease;
    font-size: 14px;
}

.btn:hover {
    opacity: 0.8;
}

.btn-primary { background: #d32f2f; color: #fff !important; }
.btn-success { background: #388e3c; color: #fff !important; }

.btn-outline { 
    background: #fff; 
    border: 1px solid #388e3c; 
    color: #388e3c !important; 
}

/* ==========================================================================
   サイドバーメニュー
   ========================================================================== */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 15px;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.sidebar-nav li:last-child a { border-bottom: none; }

.sidebar-nav li a:hover {
    background: #f8f9fa;
    color: #d32f2f;
}

/* ==========================================================================
   フォーム要素
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    margin-top: 5px;
}

textarea {
    resize: vertical;
}