/* ==========================================
   みんなのマップひろば - スタイルシート
   ========================================== */

/* カスタムプロパティ */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #F44336;
    --warning-color: #FF9800;
    --dark-bg: #1a1a1a;
    --light-bg: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --transition-base: all 0.3s ease;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* 基本スタイル */
body {
    background-color: var(--light-bg);
}

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

/* ページヘッダーのカスタマイズ（高さを小さく） */
.page-header {
    padding: calc(var(--spacing-xl) * 1.2) 0 !important;
}

.page-header__title {
    font-size: 36px !important;
    margin-bottom: var(--spacing-xs) !important;
}

.page-header__subtitle {
    font-size: 16px !important;
}

/* フィルターセクション */
.filter-section {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-select {
    padding: 10px 40px 10px 15px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    transition: var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* ローディング */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* マップセクション */
.map-sections {
    padding-bottom: 60px;
}

.map-section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 32px;
}

/* マップグリッド */
.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* 小さい画面でも最低2列を維持 */
@media (max-width: 600px) {
    .map-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* マップカード */
.map-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    position: relative;
}

.map-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.map-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.map-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 アスペクト比 */
    overflow: hidden;
    background: #f0f0f0;
}

.map-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.map-card:hover .map-card-image {
    transform: scale(1.05);
}

.map-card-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge-game {
    background: rgba(33, 150, 243, 0.9);
    color: white;
}

.map-card-content {
    padding: 16px;
}

.map-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-card-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-icon {
    font-size: 16px;
}

.stat-value {
    font-weight: 500;
}

/* もっと見るボタン */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
}

.load-more-btn:hover {
    background: var(--primary-color);
    color: white;
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-icon {
        font-size: 28px;
    }
    
    .map-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .load-more-btn {
        width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .map-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* エラーメッセージ */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.error-message p {
    font-size: 16px;
    margin: 10px 0;
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-message {
    font-size: 18px;
    margin: 0;
}

/* フォーマット用ユーティリティ */
.format-number {
    font-variant-numeric: tabular-nums;
}

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

.map-card {
    animation: fadeIn 0.5s ease forwards;
}

.map-card:nth-child(n) {
    animation-delay: calc(n * 0.05s);
}