/* CSS変数（カラーパレット） */
:root {
    /* ライトモード */
    --bg-primary: #ffffff;
    --bg-secondary: #f2f2f7;
    --bg-tertiary: #ffffff;
    --text-primary: #000000;
    --text-secondary: #3c3c43;
    --text-tertiary: #8e8e93;
    --separator: #c6c6c8;
    --accent: #007aff;
    --accent-hover: #0051d5;
    --accent-active: #0040a8;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --error-bg: #ff3b30;
    --success-bg: #34c759;
    --warning-bg: #ff9500;
    --border-radius: 12px;
    --border-radius-small: 8px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ダークモード */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #1c1c1e;
        --bg-tertiary: #2c2c2e;
        --text-primary: #ffffff;
        --text-secondary: #ebebf5;
        --text-tertiary: #8e8e93;
        --separator: #38383a;
        --accent: #0a84ff;
        --accent-hover: #409cff;
        --accent-active: #64b5f6;
        --card-bg: #1c1c1e;
        --card-shadow: rgba(0, 0, 0, 0.3);
        --error-bg: #ff453a;
        --success-bg: #32d74b;
        --warning-bg: #ff9f0a;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* タブナビゲーション */
.app-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 12px 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--separator);
    box-shadow: var(--shadow-sm);
}
.app-tab {
    padding: 8px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-small);
    transition: background-color 0.2s, color 0.2s;
}
.app-tab:hover {
    color: var(--accent);
    background-color: rgba(0, 122, 255, 0.08);
}
.app-tab.active {
    color: var(--accent);
    background-color: rgba(0, 122, 255, 0.12);
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-lg);
}

/* ヘッダー */
.header {
    background-color: var(--bg-primary);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid var(--separator);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.btn-location {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.625rem 1rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    min-height: 44px;
    box-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
}

.btn-location:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
    transform: translateY(-1px);
}

.btn-location:active {
    background-color: var(--accent-active);
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
}

.btn-icon {
    font-size: 1rem;
    display: inline-block;
    transition: transform 0.2s ease;
}

.btn-location:active .btn-icon {
    transform: scale(0.95);
}

/* 住所検索バー */
.address-search {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-primary);
    border-bottom: 0.5px solid var(--separator);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.search-input-wrapper {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.address-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    min-height: 44px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.address-input::placeholder {
    color: var(--text-tertiary);
}

.address-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.btn-search {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    min-height: 44px;
    min-width: 64px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    box-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
    white-space: nowrap;
}

.btn-search:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
    transform: translateY(-1px);
}

.btn-search:active {
    background-color: var(--accent-active);
    transform: translateY(0) scale(0.98);
}

.btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-search:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 検索地点マーカーのツールチップ */
.search-location-tooltip {
    background-color: rgba(255, 149, 0, 0.9);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.search-location-tooltip::before {
    border-right-color: rgba(255, 149, 0, 0.9);
}

/* ローディング表示 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
    animation: fadeIn 0.3s ease;
}

.loading.hidden {
    display: none;
    animation: fadeOut 0.3s ease;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* エラーメッセージ */
.error-message {
    background-color: var(--error-bg);
    color: white;
    padding: var(--spacing-md);
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    box-shadow: var(--shadow-md);
}

.error-message.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* マップコンテナ（スクロール可能なページ内に配置） */
.map-container {
    flex-shrink: 0;
    height: 45vh;
    min-height: 280px;
    position: relative;
    background-color: var(--bg-tertiary);
    transition: background-color 0.3s ease;
}

.map {
    width: 100%;
    height: 100%;
}

/* Leafletコントロールのスタイル調整 */
.leaflet-control-zoom {
    border-radius: var(--border-radius-small) !important;
    box-shadow: var(--shadow-md) !important;
    border: none !important;
    overflow: hidden;
    background-color: var(--bg-primary) !important;
    transition: background-color 0.3s ease;
}

.leaflet-control-zoom a {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--separator) !important;
    transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
    background-color: var(--bg-secondary) !important;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-lg) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    padding: 12px !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.leaflet-popup-tip {
    background-color: var(--bg-primary) !important;
    transition: background-color 0.3s ease;
}

.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
    font-size: 20px !important;
    padding: 8px !important;
    transition: color 0.2s ease;
}

.leaflet-popup-close-button:hover {
    color: var(--text-primary) !important;
}

.facility-popup {
    animation: popupFadeIn 0.3s ease;
}

.facility-popup-content {
    min-width: 180px;
    padding: 4px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.facility-popup-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.facility-popup-address {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.search-location-popup-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--warning-bg);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* マーカーのスタイル */
.facility-marker {
    animation: markerBounce 0.5s ease;
}

/* ピンアイコン（マップ施設マーカー用） */
.map-pin-fill {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    position: relative;
    width: 0.8em;
    height: 0.8em;
    background: currentColor;
    border: 0.1em solid currentColor;
    border-radius: 40% 60% 0% 100% / 40% 100% 0% 60%;
    box-sizing: content-box;
    transform: rotate(45deg);
    font-size: 24px;
}

.map-pin-fill::before {
    content: '';
    position: absolute;
    top: 18%;
    left: 18%;
    width: 0.336em;
    height: 0.336em;
    background: #fff;
    border-radius: 50%;
}

.map-pin-fill--ss {
    color: #ff3b30;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.map-pin-fill--non-ss {
    color: #9ca3af;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.map-pin-wrapper {
    position: relative;
    width: 24px;
    height: 36px;
}

.map-pin-wrapper .map-pin-fill {
    position: absolute;
    left: 50%;
    bottom: 0;
    margin-left: -0.4em;
    transform: rotate(45deg);
    transform-origin: 50% 100%;
}

@keyframes markerBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.leaflet-marker-icon {
    transition: transform 0.2s ease;
}

.leaflet-marker-icon:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

/* 現在地マーカーのアニメーション（パルス効果） */
.leaflet-interactive[fill="#007aff"] {
    animation: locationPulse 2s ease-in-out infinite;
}

@keyframes locationPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* スムーズなスクロール */
html {
    scroll-behavior: smooth;
}

/* フォーカス状態の改善（アクセシビリティ） */
.btn-location:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.facility-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 選択テキストのスタイル */
::selection {
    background-color: var(--accent);
    color: white;
}

::-moz-selection {
    background-color: var(--accent);
    color: white;
}

/* リストコンテナ（表示領域を広く、ページスクロールでマップも含めて閲覧可能） */
.list-container {
    background-color: var(--bg-primary);
    flex: 0 0 auto;
    min-height: 55vh;
    box-shadow: 0 -4px 16px var(--card-shadow);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.list-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 0.5px solid var(--separator);
    transition: border-color 0.3s ease;
}

.list-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
    margin: 0;
}

.distance-filter {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
    border-radius: var(--border-radius-small);
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    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='%238e8e93' d='M2.5 4.5l3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px;
    min-height: 36px;
}

.distance-filter:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.distance-filter.hidden {
    display: none;
}

.distance-filter:hover {
    border-color: var(--accent);
}

.facility-list {
    padding: var(--spacing-md);
    -webkit-overflow-scrolling: touch;
}

/* 施設多数時はリスト内スクロール（ページが長くなりすぎないよう） */
@media (max-height: 600px) {
    .facility-list {
        max-height: 40vh;
        overflow-y: auto;
    }
}

.no-location {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

/* 施設アイテム（カードデザイン） */
.facility-item {
    background-color: var(--card-bg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    box-shadow: var(--shadow-sm);
    border: 0.5px solid var(--separator);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.3s ease backwards;
}

.facility-item:nth-child(1) { animation-delay: 0.05s; }
.facility-item:nth-child(2) { animation-delay: 0.1s; }
.facility-item:nth-child(3) { animation-delay: 0.15s; }
.facility-item:nth-child(4) { animation-delay: 0.2s; }
.facility-item:nth-child(5) { animation-delay: 0.25s; }

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

.facility-item:hover {
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.facility-item:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-sm);
}

.facility-item.active {
    background-color: var(--accent);
    color: white;
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.facility-item.active .facility-name {
    color: white;
}

.facility-item.active .facility-address {
    color: rgba(255, 255, 255, 0.8);
}

.facility-item.active .facility-distance {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* アコーディオン（折りたたみ） */
.facility-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--separator);
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    padding: 0;
}

.toggle-button::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease, margin-top 0.2s ease;
    margin-top: -2px;
}

.facility-item:not(.collapsed) .toggle-button::after {
    transform: rotate(-135deg);
    margin-top: 2px;
}

.toggle-button:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.facility-item.active .toggle-button {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
}

.facility-item-body {
    overflow: hidden;
    max-height: 800px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.facility-item.collapsed .facility-item-body {
    max-height: 0;
    opacity: 0;
}

.facility-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xs);
}

.facility-item.collapsed .facility-item-header {
    margin-bottom: 0;
}

.facility-name {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.01em;
    flex: 1;
    transition: color 0.2s ease;
}

.facility-address {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
    transition: color 0.2s ease;
}

.facility-distance {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background-color: rgba(0, 122, 255, 0.1);
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* スクロールバーのスタイル（WebKit） */
.facility-list::-webkit-scrollbar {
    width: 6px;
}

.facility-list::-webkit-scrollbar-track {
    background: transparent;
}

.facility-list::-webkit-scrollbar-thumb {
    background: var(--separator);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.facility-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* レスポンシブデザイン（タブレット以上） */
@media (min-width: 768px) {
    .header {
        padding: var(--spacing-lg);
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .btn-location {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .map-container {
        height: 50vh;
    }

    .list-container {
        min-height: 50vh;
    }
    
    .list-title-bar {
        padding: var(--spacing-lg);
    }
    
    .list-title {
        font-size: 1.25rem;
    }
    
    .facility-list {
        padding: var(--spacing-md);
    }
    
    .facility-item {
        padding: var(--spacing-lg);
    }
    
    .facility-name {
        font-size: 1.125rem;
    }
    
    .facility-address {
        font-size: 0.9375rem;
    }
}

/* マーカー距離ツールチップ（ホバー時にふわっと表示） */
.distance-tooltip {
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    animation: tooltipFadeIn 0.2s ease forwards;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.distance-tooltip::before {
    border-right-color: rgba(0, 0, 0, 0.8);
}

/* 電話ボタン */
.phone-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    padding: 0.5rem 1rem;
    min-height: 44px;
    background-color: rgba(52, 199, 89, 0.1);
    color: #34c759;
    border: 1px solid rgba(52, 199, 89, 0.3);
    text-align: center;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
}

.phone-button:hover {
    background-color: #34c759;
    color: #ffffff;
}

.phone-button:active {
    background-color: #2db84e;
    color: #ffffff;
}

.phone-icon {
    font-size: 1rem;
}

.facility-item.active .phone-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.facility-item.active .phone-button:hover {
    background-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

/* 非SS予約拠点の案内メッセージ */
.non-ss-notice {
    margin-top: var(--spacing-sm);
    padding: 0.75rem 1rem;
    background-color: rgba(255, 149, 0, 0.08);
    border: 1px solid rgba(255, 149, 0, 0.25);
    border-radius: var(--border-radius-small);
    color: #c46a00;
    font-size: 0.85rem;
    line-height: 1.5;
}

.facility-item.active .non-ss-notice {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* 予約状況表示 */
.facility-reservation-status {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--separator);
}

.reservation-week-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.reservation-days {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reservation-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.reservation-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 0;
    border-radius: var(--border-radius-small);
    transition: background-color 0.2s ease;
}

.reservation-day:hover {
    background-color: var(--bg-secondary);
}

.reservation-day:hover .day-status {
    transform: scale(1.1);
}

.reservation-day:hover .day-status.status-available {
    background-color: rgba(52, 199, 89, 0.2);
    box-shadow: 0 1px 4px rgba(52, 199, 89, 0.3);
}

.reservation-day:hover .day-status.status-limited {
    background-color: rgba(255, 149, 0, 0.2);
    box-shadow: 0 1px 4px rgba(255, 149, 0, 0.3);
}

.reservation-day:hover .day-status.status-full {
    background-color: rgba(255, 59, 48, 0.2);
    box-shadow: 0 1px 4px rgba(255, 59, 48, 0.3);
}

.day-date {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    margin-bottom: 1px;
    font-weight: 500;
    line-height: 1.2;
}

.day-status {
    font-size: 0.875rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1;
    border: 1.5px solid transparent;
}

/* ステータス別の色 */
.status-available {
    color: var(--success-bg);
    background-color: rgba(52, 199, 89, 0.12);
    border-color: rgba(52, 199, 89, 0.2);
}

.status-limited {
    color: var(--warning-bg);
    background-color: rgba(255, 149, 0, 0.12);
    border-color: rgba(255, 149, 0, 0.2);
}

.status-full {
    color: var(--error-bg);
    background-color: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.2);
}

.status-unknown {
    color: var(--text-tertiary);
    background-color: var(--bg-secondary);
    border-color: var(--separator);
}

/* アクティブな施設アイテム内の予約状況 */
.facility-item.active .reservation-week-label {
    color: rgba(255, 255, 255, 0.8);
}

.facility-item.active .day-date {
    color: rgba(255, 255, 255, 0.7);
}

.facility-item.active .status-available {
    color: var(--success-bg);
    background-color: rgba(255, 255, 255, 0.2);
}

.facility-item.active .status-limited {
    color: var(--warning-bg);
    background-color: rgba(255, 255, 255, 0.2);
}

.facility-item.active .status-full {
    color: var(--error-bg);
    background-color: rgba(255, 255, 255, 0.2);
}

.facility-item.active .status-unknown {
    color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.1);
}

/* 予約状況カレンダーボタン */
.calendar-button {
    display: block;
    margin-top: var(--spacing-md);
    padding: 0.625rem 1rem;
    min-height: 44px;
    background-color: #ffffff;
    color: var(--accent);
    border: 1px solid var(--accent);
    text-align: center;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
}

.calendar-button:hover {
    background-color: var(--accent);
    color: #ffffff;
}

.calendar-button:active {
    background-color: var(--accent-active);
    color: #ffffff;
}

.facility-item.active .calendar-button {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--accent);
    border-color: rgba(255, 255, 255, 0.5);
}

.facility-item.active .calendar-button:hover {
    background-color: #ffffff;
    color: var(--accent);
}

/* 予約ボタン */
.reservation-button {
    display: block;
    margin-top: var(--spacing-sm);
    padding: 0.625rem 1rem;
    min-height: 44px;
    background-color: var(--accent);
    color: #ffffff;
    text-align: center;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    box-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
}

.reservation-button:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
    color: #ffffff;
}

.reservation-button:active {
    background-color: var(--accent-active);
    color: #ffffff;
}

.facility-item.active .reservation-button {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.facility-item.active .reservation-button:hover {
    background-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

/* 予約システム準備中メッセージ */
.reservation-unavailable {
    margin-top: var(--spacing-md);
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--border-radius-small);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    border: 1px solid var(--separator);
}

.facility-item.active .reservation-unavailable {
    background-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .status-available {
        color: var(--success-bg);
        background-color: rgba(52, 199, 89, 0.15);
    }
    
    .status-limited {
        color: var(--warning-bg);
        background-color: rgba(255, 149, 0, 0.15);
    }
    
    .status-full {
        color: var(--error-bg);
        background-color: rgba(255, 59, 48, 0.15);
    }
}

/* タブレット以上での予約状況表示 */
@media (min-width: 768px) {
    .reservation-days {
        gap: var(--spacing-md);
    }
    
    .reservation-day {
        min-width: 48px;
        padding: var(--spacing-sm);
    }
    
    .day-date {
        font-size: 0.75rem;
    }
    
    .day-status {
        font-size: 1.625rem;
        width: 40px;
        height: 40px;
    }
    
    .reservation-week-label {
        font-size: 0.8125rem;
    }
}










