/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

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

/* ヘッダー */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* 言語切り替えナビゲーション */
.nav {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.logo-text {
    text-align: left;
}

.logo {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* メインコンテンツ */
.main {
    padding: 3rem 0;
}

/* 投稿タイプ選択セクション */
.post-type-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.post-type-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.post-type-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.post-type-btn.active {
    border-color: #e74c3c;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* セクション */
.post-form-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #e74c3c;
}

.posts-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #2c3e50;
}

.team-form {
    border-left-color: #e74c3c;
}

.player-form {
    border-left-color: #3498db;
}

.division-form {
    border-left-color: #27ae60;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 0.5rem;
}

.team-form h2 {
    border-bottom-color: #e74c3c;
}

.player-form h2 {
    border-bottom-color: #3498db;
}

.division-form h2 {
    border-bottom-color: #27ae60;
}

.posts-section h2 {
    border-bottom-color: #2c3e50;
}

/* 投稿フィルター */
.posts-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

/* すべてボタン - Dark Gray */
.filter-btn[data-filter="all"].active {
    background: #495057;
    border-color: #495057;
    color: white;
}

/* チームメイト募集中ボタン - 赤 */
.filter-btn[data-filter="team-recruit"].active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* チームを探していますボタン - 青 */
.filter-btn[data-filter="player-seeking"].active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* ディビジョンを創りたいボタン - 緑 */
.filter-btn[data-filter="division-create"].active {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

/* フォーム */
.post-form,
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* フォームセクションヘッダー */
.form-section-header {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
}

.form-section-header h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.form-section-header p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0;
}

label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

input,
textarea,
select {
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    background: white;
    cursor: pointer;
}

/* ボタン */
.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.btn-tertiary {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-tertiary:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

/* 投稿一覧 */
.posts-list {
    display: grid;
    gap: 2rem;
    padding: 1rem 0;
}

.post-card {
    background: white;
    border: 3px solid #ecf0f1;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.post-card.team-recruit {
    border: 3px solid #e74c3c;
    background: linear-gradient(135deg, #fff 0%, #fef7f7 100%);
}

.post-card.team-recruit:hover {
    border-color: #c0392b;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.2);
}

.post-card.player-seeking {
    border: 3px solid #3498db;
    background: linear-gradient(135deg, #fff 0%, #f7fbff 100%);
}

.post-card.player-seeking:hover {
    border-color: #2980b9;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.2);
}

.post-card.division-create {
    border: 3px solid #27ae60;
    background: linear-gradient(135deg, #fff 0%, #f7fff7 100%);
}

.post-card.division-create:hover {
    border-color: #229954;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.2);
}

.post-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.post-type-badge.team-recruit {
    background: #e74c3c;
}

.post-type-badge.player-seeking {
    background: #3498db;
}

.post-type-badge.division-create {
    background: #27ae60;
}

.post-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    cursor: pointer;
    line-height: 1.3;
}

.post-title:hover {
    color: #3498db;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.post-content {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.post-details {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid #95a5a6;
}

.post-details h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.post-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.post-detail-item {
    font-size: 0.9rem;
}

.post-detail-label {
    font-weight: 600;
    color: #7f8c8d;
}

.post-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.post-date {
    font-size: 0.85rem;
    color: #95a5a6;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #e74c3c;
}

/* 投稿詳細 */
.post-detail {
    line-height: 1.8;
}

.post-detail h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.post-detail .meta {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
}

.post-detail .content {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 1.5rem;
}

.post-detail .details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #95a5a6;
}

/* フッター */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-image {
        width: 60px;
        height: 60px;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .logo-text {
        text-align: center;
    }
    
    .main {
        padding: 2rem 0;
    }
    
    .post-form-section,
    .posts-section {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .post-type-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .posts-filter {
        justify-content: center;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
    
    .post-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
    
    .post-header {
        padding-right: 0;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-type-badge {
        position: static;
        align-self: flex-start;
        margin-bottom: 0.5rem;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.5s ease-out;
}

/* ローディング */
.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功・エラーメッセージ */
.message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* PIN削除モーダル用スタイル */
.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.form-help {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
    display: block;
}

/* タブナビゲーション */
.tab-navigation {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #2c3e50;
    background-color: #f8f9fa;
}

.tab-btn.active {
    color: #2c3e50;
    border-bottom-color: #3498db;
    background-color: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* フォームノート */
.form-note {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-left: 3px solid #3498db;
    border-radius: 3px;
}
