:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --primary-color: #012c6b;
    --primary-hover: #0a408f;
    --accent-color: #db50ca;
    --accent-yellow: #f8ec38;
    --accent-pink: #db50ca;
    --text-main: #0c0f17;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 14px; /* 本文サイズに最適化 */
}

/* ヘッダー */
header {
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--primary-color);
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent-pink);
}

nav a.admin-link {
    color: var(--text-muted) !important;
    font-size: 0.8rem;
    margin-left: 2rem;
    transition: color 0.3s, opacity 0.3s;
    opacity: 0.7;
}

nav a.admin-link:hover {
    color: var(--primary-color) !important;
    opacity: 1;
}

/* メインコンテナ */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ヒーローセクション */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 1rem;
}

.hero h1 {
    font-size: 36px; /* 大タイトル 36px */
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    color: var(--primary-color);
}

.hero p {
    color: var(--text-muted);
    font-size: 14px; /* 本文 */
    max-width: 600px;
    margin: 0 auto;
}

/* スペースカードグリッド */
.spaces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.space-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.space-card:hover {
    transform: translateY(-5px);
    border-color: rgba(1, 44, 107, 0.3);
    box-shadow: 0 10px 30px rgba(1, 44, 107, 0.08);
}

.space-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #e2e8f0;
}

.space-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.space-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.space-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.space-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.space-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn:active {
    transform: scale(0.98);
}

/* 予約エリア・モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 15, 23, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--text-main);
}

/* カレンダー & フォーム */
.calendar-container {
    margin-bottom: 1.5rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-day-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem 0;
}

.calendar-day {
    padding: 0.75rem 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
    border: 1px solid transparent;
    color: var(--text-dark);
}

.calendar-day:hover:not(.disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.calendar-day.selected {
    background: var(--primary-color) !important;
    color: white;
}

.calendar-day.has-reservations {
    border-bottom: 3px solid var(--warning-color);
}

.calendar-day.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* フォーム入力 */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 12px; /* 本文見出し 12px */
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(1, 44, 107, 0.1);
}

/* 管理画面用テーブルなど */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 12px; /* 本文見出し 12px */
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-approved { background: rgba(1, 44, 107, 0.1); color: var(--primary-color); border: 1px solid rgba(1, 44, 107, 0.2); }
.status-cancelled { background: rgba(239, 68, 68, 0.1); color: var(--danger-color); border: 1px solid rgba(239, 68, 68, 0.2); }

/* タイムラインバー */
.timeline-wrapper {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 20px;
}

.timeline-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background: #f1f5f9;
    /* 1時間ごとに縦の目盛り線を描画 (100% / 24 = 4.166%) */
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent calc(4.166% - 1px),
        #cbd5e1 calc(4.166% - 1px),
        #cbd5e1 4.166%
    );
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

.timeline-segment {
    position: absolute;
    height: 100%;
    background: #cbd5e1;
    opacity: 0.9;
    z-index: 1;
}

.timeline-selection {
    position: absolute;
    height: 100%;
    background: rgba(1, 44, 107, 0.2);
    border-left: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    z-index: 2;
    pointer-events: none;
}

.timeline-selection.overlap {
    background: rgba(239, 68, 68, 0.25) !important;
    border-left-color: var(--danger-color) !important;
    border-right-color: var(--danger-color) !important;
}

.timeline-labels {
    position: relative;
    width: 100%;
    height: 15px;
    margin-top: 6px;
}

.timeline-label {
    position: absolute;
    font-size: 0.72rem;
    color: var(--text-muted);
    transform: translateX(-50%);
}

@media (max-width: 500px) {
    .timeline-label.mobile-hide {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 28px;
    }
    header {
        flex-direction: column;
        gap: 1rem;
    }
    nav a {
        margin: 0 0.75rem;
    }
}
