/* ----------  リセットCSS  ---------- */
body {
    width: 100vw;
    height: 100vh;
    font-family: sans-serif;
    margin: 0;
    padding: 0;
}

/* モバイル横スクロール対策 - Bootstrap container padding調整 */
@media (max-width: 575.98px) {
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        max-width: none !important;
    }
    
    .row {
        margin-left: -10px !important;
        margin-right: -10px !important;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

a, a:link, a:hover, a:visited, a:active {
    /* background-color: inherit; */
    text-decoration: none;
    /* color: inherit; */
}

/* ----------  ボタンのデザイン  ---------- */

/* ページ遷移、保存、戻るなど : 濃い青ボタン */
.btn-dark {
    background-color: var(--theme-primary, #5c61a1);
    color: #ffffff;
}
.btn-dark:hover {
    background-color: var(--theme-primary-hover, #8e9fcb);
    color: #ffffff;
}
.btn-dark:disabled {
    background-color: var(--theme-primary-disabled, #d9d9d9);
    color: #2b2b2b;
}

/* ページ遷移、保存、戻るなど : 薄い青ボタン */
.btn-light {
    background-color: var(--theme-secondary, #8e9fcb);
    color: #ffffff;
}
.btn-light:hover {
    background-color: var(--theme-secondary-hover, #5c61a1);
    color: #ffffff;
}
.btn-light:disabled {
    background-color: var(--theme-secondary-disabled, #d9d9d9);
    color: #2b2b2b;
}

/* ----------  バッジのデザイン  ---------- */
.badge-primary {
    background-color: white;
    border: none;
    color: var(--theme-primary-text);
    border-radius: 30px;
    box-shadow: 3px 3px 3px 0px rgba(0,0,0,0.45);
}

/* ----------  ホーム画面専用スタイル  ---------- */

/* カード型レイアウト */
.community-card {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.community-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* ヘッダー部分のグラデーション */
.community-header {
    background: linear-gradient(135deg, var(--theme-primary, #8e9fcb), var(--theme-primary-hover, #5c61a1));
    padding: 0.5rem 1rem;
    color: white;
    border-radius: 8px 8px 0 0;
    min-height: 0;
}

/* カード内要素の間隔統一 */
.community-card .row {
    margin: 0;
}

.community-card .col-12,
.community-card .col-6,
.community-card .col-md-12 {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* 句会情報エリアの整理 */
.kukai-info-section {
    padding: 0.5rem 1rem;
    background: white;
    min-height: 45px;
    display: flex;
    align-items: center;
}

/* 開催状況バッジの改良 */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.status-badge.active {
    background: var(--theme-primary, #8e9fcb);
    color: white;
}

.status-badge.inactive {
    background: var(--theme-border, #dee2e6);
    color: #666;
}

/* ボタンエリアの整理 */
.action-buttons {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid var(--theme-border, #dee2e6);
}

/* ステータスボタンの改良 */
.status-phase {
    background: var(--theme-background, #ffffff);
    color: var(--theme-primary-text, #2b2b2b);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 90px;
    width: 15%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 3px 3px 3px 0px rgba(0,0,0,0.45);
}

.status-phase.active {
    background: var(--theme-action, #dc3545);
    color: white;
}

.status-phase:hover:not(.active) {
    background: var(--theme-background, #f8f9fa);
    color: var(--theme-primary-text, #2b2b2b);
}

/* 大きなボタン（高齢者向け） */
.btn-large {
    min-height: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    padding: 0.4rem 1rem;
}

.btn-large:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* テキストサイズの拡大 */
.home-text-large {
    font-size: 1.5rem;
    line-height: 1.5;
}

/* アクセシビリティ向上 */
.focus-ring:focus {
    outline: 3px solid var(--theme-accent, #ffc107);
    outline-offset: 2px;
}

/* ステータスフェーズのヘッダーとボディ */
.status-phase-header {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 4px;
}

.status-phase-body {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ステータス矢印ボタン */
.status-arrow-btn {
    background: var(--theme-action, #dc3545);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin: 2px 0;
}

.status-arrow-btn:hover:not(:disabled) {
    background: var(--theme-action-hover, #bb2d3b);
    transform: scale(1.05);
}

.status-arrow-btn:disabled {
    background: var(--theme-primary-disabled, #d9d9d9);
    color: #666;
    cursor: not-allowed;
}

/* スマホ対応のレスポンシブデザイン */
@media (max-width: 768px) {
    /* プログレスフローの調整 */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* 矢印コンテナを横並びに変更 */
    .d-flex.flex-column.align-items-center.gap-1 {
        flex-direction: row !important;
        justify-content: center;
        gap: 0.5rem !important;
    }
    
    /* スマホでは矢印の向きを上下に変更 */
    .status-arrow-btn .fa-arrow-right {
        transform: rotate(90deg); /* 右矢印を下向きに */
    }
    
    .status-arrow-btn .fa-arrow-left {
        transform: rotate(90deg); /* 左矢印を上向きに */
    }
    
    /* カード内要素の調整 */
    .community-card .community-header {
        padding: 0.4rem 0.8rem;
    }
    
    .community-card .kukai-info-section {
        padding: 0.4rem 0.8rem;
        min-height: 40px;
    }
    
    .community-card .action-buttons {
        padding: 0.4rem 0.8rem;
    }
    
    /* ステータスフェーズをスマホ用に調整 */
    .status-phase {
        min-height: 50px;
        padding: 8px;
        margin-bottom: 0.5rem;
        width: 100%;
        min-height: 60px;
    }
    
    .status-phase-header {
        font-size: 0.9rem;
    }
    
    .status-phase-body {
        font-size: 0.7rem;
    }
    
    /* 矢印ボタンを小さく */
    .status-arrow-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    /* ボタンサイズの調整 */
    .btn-large {
        min-height: 44px;
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* テキストサイズの調整 */
    .home-text-large {
        font-size: 1rem;
    }
    
    /* gap調整 */
    .gap-1 {
        gap: 0.25rem !important;
    }
}

@media (max-width: 576px) {
    /* より小さな画面用 */
    .status-phase {
        min-height: 45px;
        padding: 6px;
    }
    
    .status-phase-header {
        font-size: 0.8rem;
    }
    
    .status-phase-body {
        font-size: 0.65rem;
    }
    
    .status-arrow-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    /* 小さなスマホでも矢印の横並び維持 */
    .d-flex.flex-column.align-items-center.gap-1 {
        flex-direction: row !important;
        gap: 0.4rem !important;
    }
    
    .btn-large {
        min-height: 45px;
        font-size: 1rem;
    }
}

/* コミュニティ概要モーダルのスタイル */
.community-name-clickable:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.community-name-clickable .fa-info-circle {
    transition: opacity 0.2s ease;
}

.community-name-clickable:hover .fa-info-circle {
    opacity: 1 !important;
    color: var(--theme-primary, #5c61a1);
}

#communityOverviewModal .modal-content {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

#communityOverviewModal .modal-header {
    background: linear-gradient(135deg, var(--theme-secondary, #5c61a1), var(--theme-primary, #8e9fcb));
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

#communityOverviewModal .modal-title {
    font-size: 1rem;
    font-weight: bold;
}

#communityOverviewModal .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

#communityOverviewModal .btn-close:hover {
    opacity: 1;
}

#communityOverviewModal .modal-body {
    font-size: 0.9rem;
    padding: 1rem;
}

#communityOverviewModal .modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 12px 12px;
}

/* スマホ対応 */
@media (max-width: 576px) {
    #communityOverviewModal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    #communityOverviewModal .modal-body {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}