/*
Theme Name: JMI Root Child
Theme URI: 
Description: JMI Root Child Theme - Blank Slate
Author: Toshi7m
Template: jmi-root
Version: 2.1.1
*/

/* Blank Slate */

/* =========================================
   DESKTOP DEFAULT (Hiding Mobile Elements)
   ========================================= */
.mobile-nav-trigger,
.mobile-menu-overlay,
.roulette-wheel,
.page-transition-ripple {
    display: none !important;
}

/* Binder System (Desktop Base) */

html,
body {
    overflow-x: hidden !important;
    /* 水平スクロール防止 */
}

.binder-container {
    width: 100vw;
    height: 100vh;
    overflow: visible !important;
    /* タブのはみ出し表示を許可 */
    position: relative;
    display: flex;
    justify-content: center;
    /* 中央配置 */
    align-items: center;
}

.binder-wrapper {
    position: relative;
    width: calc(100vw - 110px);
    /* 左右各55pxのタブスペースを確保 */
    height: 100vh;
    perspective: 2000px;
}

/* binder-wrapper dimensionsはクラスで定義済み。インラインスタイルの上書きを廃止 */

.sheet-stack {
    position: relative;
    width: 50%;
    height: 100%;
    margin-left: 50%;
    /* 親テーマと同じ: 右半分に配置 */
    transform-style: preserve-3d;
}

.sheet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1.000);
    pointer-events: none;
}

.sheet-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background-color: #f0f0f0;
    pointer-events: auto;
}

.sheet-face.back {
    transform: rotateY(180deg);
}

.sheet-tab {
    position: absolute;
    right: -45px;
    /* sheetの外にはみ出す */
    width: 45px;
    height: calc((100vh - 20px) / 6);
    /* 6タブをギャップなしで均等配置 */
    border-radius: 0 15px 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    white-space: nowrap;
    /* テキスト折り返し防止 */
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    top: calc(10px + var(--order) * ((100vh - 20px) / 6));
    z-index: 100;
    pointer-events: auto;
    font-family: 'BIZ UDPGothic', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sheet-tab:hover {
    transform: translateX(5px);
}

/* Open State (Flip) */
.sheet.is-flipped {
    transform: rotateY(-180deg);
}

/* フリップ後のタブとページの間にギャップを確保 */
.sheet.is-flipped .sheet-tab {
    right: -50px;
}

.sheet-content {
    width: 100%;
    height: 100%;
    padding: 40px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.sheet-content::-webkit-scrollbar {
    width: 6px;
}

.sheet-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Base Styles (Desktop) */
.root-action-buttons {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: flex;
    gap: 15px;
    z-index: 500000;
}

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .binder-container {
        perspective: none !important;
        overflow-y: auto !important;
        display: block !important;
    }

    .binder-wrapper {
        width: 100% !important;
        height: auto !important;
        min-height: 100vh;
        display: block !important;
        background-color: transparent !important;
        background-image: var(--mobile-bg) !important;
        background-size: cover !important;
        background-attachment: fixed !important;
    }

    /* Hide Binder UI */
    .sheet-tab,
    .sheet-face.back,
    .sheet-stack::before {
        display: none !important;
    }

    .sheet-stack {
        width: 100% !important;
        margin-left: 0 !important;
        height: auto !important;
        transform: none !important;
    }

    .sheet {
        position: static !important;
        display: none;
        width: 100% !important;
        height: auto !important;
        min-height: 100vh;
        background: transparent !important;
        transform: none !important;
        box-shadow: none !important;
    }

    .sheet.mobile-active {
        display: block !important;
    }

    /* Global Buttons Container */
    .root-action-buttons {
        position: fixed !important;
        bottom: 0;
        right: 0;
        width: 100px;
        height: 100px;
        z-index: 500001 !important;
        pointer-events: none;
    }

    /* Center Trigger (Hamburger) */
    .mobile-nav-trigger {
        position: fixed !important;
        bottom: 25px !important;
        right: 20px !important;
        width: 65px !important;
        height: 65px !important;
        background: #333 !important;
        color: #fff !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 500005 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
        pointer-events: auto;
        cursor: pointer;
        line-height: 0 !important;
    }

    .mobile-nav-trigger svg {
        display: block;
        margin: 0 !important;
    }

    /* Roulette Wheel - Centered on Hamburger */
    .roulette-wheel {
        display: block !important;
        position: fixed !important;
        bottom: 57.5px;
        right: 52.5px;
        width: 450px;
        height: 450px;
        margin-bottom: -225px;
        margin-right: -225px;
        z-index: 500002;
        pointer-events: auto;
        opacity: 0;
        visibility: hidden;
        transform: scale(0) rotate(var(--wheel-rotation));
        transform-origin: center center;
        transition: opacity 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .is-menu-open .roulette-wheel {
        opacity: 1;
        visibility: visible;
        transform: scale(1) rotate(var(--wheel-rotation));
    }

    .wheel-item {
        position: absolute;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        border: none;
        display: flex;
        flex-direction: row-reverse;
        /* Always Label Left, Icon Right */
        align-items: center;
        justify-content: flex-start;
        /* Pin to Right (Start of Row-Reverse) */
        padding-right: 20px;
        /* Center Icon in 60px (Icon 20 + Pad 20 = 40. Left space = 20) */

        color: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        cursor: pointer;
        padding-left: 0;

        left: 50%;
        top: 50%;
        margin-left: -30px;
        margin-top: -30px;
        z-index: 500003;

        /* Positioning & Upright Icon Logic */
        transform: rotate(var(--base-angle)) translate(80px) rotate(calc(-1 * var(--base-angle) - var(--wheel-rotation)));

        /* Spring-like transition */
        transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
            padding 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
            border-radius 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
            margin 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
            transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* Active Item (Expanded at 9 o'clock) */
    .wheel-item.is-active-item {
        /* User Requirement: Dynamic resize based on text length. 
           Variables set by JS on page load. Fallbacks provided. */
        width: var(--target-width, 200px) !important;
        padding-right: 20px !important;
        /* Keep Icon fixed */
        padding-left: 20px !important;
        /* Label padding */

        border-radius: 30px !important;

        display: flex !important;
        justify-content: flex-start !important;

        /* Expansion Logic: Shift outwards dynamically */
        transform: rotate(var(--base-angle)) translate(var(--target-translate, 150px)) rotate(calc(-1 * var(--base-angle) - var(--wheel-rotation)));

        /* Maintain Center Anchor dynamically */
        margin-left: var(--target-margin, -100px) !important;
        min-width: unset;
    }

    .wheel-label {
        font-size: 14px;
        font-weight: bold;
        margin-right: 0;
        margin-left: 0;
        white-space: nowrap;
        opacity: 0;
        max-width: 0;
        overflow: hidden;
        /* Sync with container expansion */
        transition: max-width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
            opacity 0.3s ease 0.1s,
            /* Slight delay for opacity */
            margin 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .wheel-item.is-active-item .wheel-label {
        opacity: 1;
        max-width: var(--label-width, 130px);
        /* Dynamic label width */
        margin-right: 8px;
    }

    /* 1. Root (Green) */
    .wheel-item:nth-child(1) {
        background: #2ECC71 !important;
    }

    /* 2. Community (Orange) */
    .wheel-item:nth-child(2) {
        background: #F39C12 !important;
    }

    /* 3. Event (Teal) */
    .wheel-item:nth-child(3) {
        background: #1ABC9C !important;
    }

    /* 4. Calendar (Blue) */
    .wheel-item:nth-child(4) {
        background: #3498DB !important;
    }

    /* 5. Sponsor (Pink) */
    .wheel-item:nth-child(5) {
        background: #FA2C70 !important;
    }

    /* 6. Instagram (Instagram Color) */
    .wheel-item:nth-child(6) {
        background: #E1306C !important;
    }

    /* 7. Contact (Gray) */
    .wheel-item:nth-child(7) {
        background: #34495E !important;
    }

    /* Instagram */
    .wheel-item:nth-child(8) {
        background: #95A5A6 !important;
    }

    /* Contact */

    /* Community/Event/Sponsor Grids (Mobile 2x2 Scroll) */
    .community-grid {
        display: inline-grid !important;
        grid-template-columns: none !important;
        grid-template-rows: repeat(2, 200px) !important;
        grid-auto-flow: column !important;
        grid-auto-columns: calc(50vw - 12.5px) !important;
        width: max-content !important;
        overflow-x: visible !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        gap: 15px !important;
        padding: 95px 15px 15px 15px !important;
        /* Fixed clearance for ticker Tape */
        height: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Scrollbar display for discoverability */
    .community-grid::-webkit-scrollbar {
        height: 6px;
        display: block;
    }

    .community-grid::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 3px;
    }

    .sheet-content,
    .container.community-grid {
        padding: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Card Sizing */
    .community-ticket,
    .ticket-card {
        scroll-snap-align: start !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
    }

    /* Content Tweak for Mobile Grid */
    .ticket-main,
    .ticket-content-wrapper {
        padding: 10px !important;
    }

    .ticket-title {
        font-size: 1rem !important;
    }

    .ticket-cat {
        font-size: 0.8rem !important;
    }

    .ticket-image {
        height: 40% !important;
    }

    /* Hide pagination (using scroll instead) */
    .pagination-btn,
    .pagination,
    .navigation.pagination {
        display: none !important;
    }

    /* Overlay */
    .mobile-menu-overlay {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(1.5px);
        z-index: 500000;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .mobile-menu-overlay.is-active {
        display: block !important;
        opacity: 1;
    }

    /* Transition Ripple */
    .page-transition-ripple {
        display: block !important;
        position: fixed;
        border-radius: 50%;
        width: 100px;
        height: 100px;
        margin-left: -50px;
        margin-top: -50px;
        transform: scale(0);
        z-index: 1000000;
        pointer-events: none;
        transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .page-transition-ripple.is-expanding {
        transform: scale(50);
    }
}

/* =========================================
   RESERVATION SYSTEM STYLES (温かみ × モダン)
   ========================================= */

/* Fonts & Container */
.reservation-container {
    --primary-color: #4CAF50;
    --primary-light: #81C784;
    --primary-dark: #388E3C;
    --accent-color: #FF8A65;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(200, 200, 200, 0.4);
    --text-color: #333;
    --text-muted: #777;
    --bg-light: #faf8f5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-soft: rgba(0, 0, 0, 0.08);

    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
    font-family: 'Noto Sans JP', 'BIZ UDPGothic', sans-serif;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.sheet-tab {
    position: absolute;
    /* Basic positioning logic is handled by inline styles or other blocks, 
       but we ensure z-index is high enough */
    z-index: 20;
    cursor: pointer;
}

/* Card Effect */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 15px;
}

.res-title {
    font-family: 'BIZ UDPGothic', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: 1px;
}

.res-step-desc {
    font-size: 0.9rem;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 50px;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.res-field {
    margin-bottom: 20px;
}

.res-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    font-family: 'Noto Sans JP', sans-serif;
}

.res-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.res-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.2);
}

/* Flatpickr Customization */
.flatpickr-calendar {
    font-family: 'Noto Sans JP', sans-serif !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid var(--border-soft) !important;
}

.flatpickr-day.selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3) !important;
}

.flatpickr-day {
    color: #333 !important;
}

.flatpickr-day.today {
    border-color: var(--accent-color) !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-weekdays,
span.flatpickr-weekday {
    background: var(--primary-color) !important;
    color: #fff !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #fff !important;
    fill: #fff !important;
}

/* Table Grid (Cyber Buttons) */
/* =========================================
   GRID RESERVATION SYSTEM (PHASE 5)
   ========================================= */

.reservation-container.wide-container {
    padding: 10px;
    height: 100%;
}

/* =========================================
   RESERVATION PANEL (Left Page)
   ========================================= */
.reservation-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 24px;
    color: var(--text-color, #333);
    font-family: 'Noto Sans JP', 'BIZ UDPGothic', sans-serif;
    overflow: hidden;
    box-sizing: border-box;
}

.res-panel-title {
    font-family: 'BIZ UDPGothic', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #388E3C;
    letter-spacing: 1px;
    margin: 0 0 12px 0;
    text-align: center;
}

.res-panel-section {
    margin-bottom: 12px;
}

.res-panel-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.res-panel-legend {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.res-panel-selection {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.res-panel-selection .res-selected-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
}

.res-panel-action {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
}

.res-panel-action .total-price {
    text-align: right;
    flex-shrink: 0;
}

.res-panel-action .res-submit-btn {
    width: auto;
    flex: 1;
    margin-top: 0;
    padding: 12px 16px;
    font-size: 1rem;
}

.res-panel-footer {
    text-align: center;
    margin-top: 8px;
}

.res-panel-footer a {
    color: #777;
    font-size: 0.78rem;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.res-panel-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* =========================================
   RESERVATION MATRIX (Right Page)
   ========================================= */
/* =========================================
   RESERVATION SYSTEM (Modern Design)
   ========================================= */

/* Left Page: Calendar & Controls */
.reservation-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    overflow-y: auto;
    background: #fff;
    /* Ensure clean background */
}

.res-panel-title {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 5px;
    text-align: center;
    border-bottom: none;
    /* Removed line for cleaner look */
    font-weight: 800;
    letter-spacing: -0.02em;
}

.res-panel-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.res-panel-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Inline Calendar Modernization */
.res-calendar-inline {
    display: flex;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.flatpickr-calendar.inline {
    box-shadow: none;
    width: 100% !important;
    max-width: 320px;
}

.flatpickr-day {
    border-radius: 50% !important;
    /* Circle days */
    border: 1px solid transparent;
}

.flatpickr-day.selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
    /* Glow effect */
}

/* Calendar Visibility Updates */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    visibility: hidden;
    /* Hide other month days */
}

.flatpickr-month {
    color: #000 !important;
    fill: #000 !important;
}

span.flatpickr-weekday {
    color: #000 !important;
    font-weight: 800 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #000 !important;
    font-weight: 800 !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: #000 !important;
}

/* Calendar Header removed per user request */

/* Legend (Moved to Right Page Header) */
.res-panel-legend {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    /* Clean style for header embedding */
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.color-box {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-box.available {
    background: #fff;
    border: 1px solid #ddd;
}

.color-box.selected {
    background: #E8F5E9;
    border: 1px solid #4CAF50;
}

.color-box.booked {
    background: #eee;
    border: 1px solid #ccc;
    background-image: repeating-linear-gradient(45deg, #ddd, #ddd 5px, #fff 5px, #fff 10px);
}

/* Selection List */
.res-panel-selection {
    background: #fff;
    padding: 0;
    border-radius: 12px;
    border: none;
    min-height: auto;
}

.res-selected-list {
    max-height: 120px;
    overflow-y: auto;
    padding: 4px;
}

.selected-slots-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    /* Chips layout */
    gap: 8px;
}

.selected-slots-list li {
    display: flex;
    align-items: center;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: 999px;
    /* Pill shape */
    font-size: 0.85rem;
    border: 1px solid var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.slot-time {
    margin-right: 6px;
}

.slot-price {
    display: none;
    /* Hide price in chips to save space */
}

.slot-remove {
    background: #fff;
    border: none;
    color: var(--primary-dark);
    cursor: pointer;
    font-size: 0.8rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 0;
    transition: background 0.2s;
}

.slot-remove:hover {
    background: #ffcdd2;
    color: #d32f2f;
}

/* Inputs */
.res-input {
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
    outline: none;
    background: #f9f9f9;
}

.res-input:focus {
    border-color: var(--primary-color);
    background: #fff;
}

/* Action Area */
.res-panel-action {
    margin-top: auto;
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.total-price {
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #555;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
}

#grid-total-price {
    font-size: 2rem;
    color: var(--primary-dark);
    line-height: 1;
}

.res-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    letter-spacing: 0.05em;
}

.res-submit-btn:disabled {
    background: #e0e0e0;
    color: #999;
    box-shadow: none;
    cursor: not-allowed;
}

.res-submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.res-submit-btn:not(:disabled):active {
    transform: translateY(1px);
}

/* Right Page: Time Slot Grid */
.reservation-timeslots {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    color: #333;
    background: #f4f6f8;
    /* Light gray background for contrast with cards */
}

.timeslot-header {
    background: #fff;
    color: #333;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    z-index: 10;
}

.timeslot-date-label {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.timeslot-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Spacing between cards */
}

/* Modern Card Style for Time Slots */
.timeslot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 2px solid transparent;
    /* Prepare for border change */
    position: relative;
    overflow: hidden;
}

.timeslot-row:hover:not(.booked) {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(76, 175, 80, 0.3);
}

.timeslot-row.selected {
    background: #F1F8E9;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

/* Selection Indicator Bar */
.timeslot-row.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--primary-color);
}

.timeslot-row.booked {
    background: #fafafa;
    border: 1px solid #eee;
    color: #bbb;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    opacity: 0.7;
}

.timeslot-row.booked::after {
    /* Stripe pattern */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.03) 10px, rgba(0, 0, 0, 0.03) 20px);
}

.timeslot-time {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    color: #333;
}

.timeslot-row.booked .timeslot-time {
    color: #aaa;
}

.timeslot-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #444;
    margin-left: auto;
    margin-right: 20px;
}

.timeslot-row.selected .timeslot-price {
    color: var(--primary-dark);
}

.timeslot-status {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.timeslot-row.selected .timeslot-status {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Placeholder State */
.grid-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    text-align: center;
    padding: 40px;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Footer & Legend (Removed old styles as they are replaced by .reservation-panel styles) */


.color-box.available {
    background: #fff;
    border: 1px solid #ccc;
}

.color-box.selected {
    background: var(--primary-light);
}

.color-box.booked {
    background: #ddd;
    background-image: repeating-linear-gradient(45deg, #ccc 0, #ccc 2px, #ddd 2px, #ddd 4px);
}

.res-total-action {
    display: flex;
    gap: 15px;
    align-items: center;
}

.total-price {
    text-align: right;
}

.total-price span:first-child {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.total-price span:last-child {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-dark);
    font-family: 'Noto Sans JP', sans-serif;
}

/* Reservation Intro (Sheet 1 Back) */
.reservation-intro {
    text-align: left;
    padding: 25px 30px;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.reservation-intro .res-title {
    text-align: center;
    margin-bottom: 20px;
}

/* Guide Steps */
.res-guide {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.guide-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.guide-text strong {
    display: block;
    font-size: 0.75rem;
    color: var(--primary-dark);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.guide-text p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #444;
}

.guide-text small {
    color: #888;
    font-size: 0.72rem;
}

/* Info Box */
.res-info-box {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 15px;
}

.res-info-box p {
    margin: 6px 0;
    font-size: 0.82rem;
    color: #555;
}

.arrow-next {
    font-size: 1.2rem;
    margin-top: auto;
    text-align: center;
    color: var(--primary-dark);
    animation: bounceRight 1.5s infinite;
    font-weight: 600;
}

@keyframes bounceRight {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(10px);
    }
}

/* Grid Placeholder (Before Date Selected) */
.grid-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #999;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.grid-placeholder p {
    font-size: 0.9rem;
    color: #aaa;
}

/* Loading */
.loading-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #aaa;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

.slot-price {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #666;
    margin-top: 2px;
    line-height: 1.2;
}

.slot-btn:hover .slot-price {
    color: #333;
}

.slot-btn.is-active .slot-price {
    color: var(--primary-dark);
    font-weight: 600;
}

.slot-btn.booked .slot-price {
    display: none;
}

/* Summary & Submit */
.res-summary {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.res-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #4CAF50 0%, #81C784 100%);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-family: 'BIZ UDPGothic', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    margin-top: 15px;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.res-submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.res-submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.res-submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
}

@media (max-width: 900px) {
    .res-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .res-date-picker-wrapper {
        width: 100%;
    }

    .res-grid-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .res-total-action {
        width: 100%;
        justify-content: space-between;
    }

    .res-submit-btn {
        width: auto;
        min-width: 170px;
        margin-top: 0;
        padding: 12px 16px;
        font-size: 1rem;
    }
}

/* 
 * TABLET / LANDSCAPE FIX (1100px) 
 * Ensures horizontal scroll applies to wider mobile devices too
 */
@media (max-width: 1100px) {
    .community-grid {
        display: inline-grid !important;
        grid-template-columns: none !important;
        grid-template-rows: repeat(2, 200px) !important;
        grid-auto-flow: column !important;
        grid-auto-columns: calc(50vw - 12.5px) !important;
        width: max-content !important;
        overflow-x: visible !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        gap: 15px !important;
        padding: 95px 15px 15px 15px !important;
        height: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .community-grid::-webkit-scrollbar {
        height: 6px;
        display: block;
    }

    .community-grid::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 3px;
    }

    .sheet-content,
    .container.community-grid {
        padding: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Hide desktop pagination */
    .pagination-btn,
    .pagination,
    .navigation.pagination {
        display: none !important;
    }

    /* Tweaks for card sizing on tablet */
    .community-ticket,
    .ticket-card {
        width: 100% !important;
        min-width: 0 !important;
        scroll-snap-align: start !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
    }

    .ticket-image {
        height: 40% !important;
    }
}

/* ===============================================
   メールアドレス入力欄（予約フォーム）
   =============================================== */
.res-email-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-bottom: 10px;
}

.res-email-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color, #4a5e3a);
}

#res-email {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #d4c5a9;
    border-radius: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    background: #fffef9;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

#res-email:focus {
    outline: none;
    border-color: var(--brand-green, #6b8e5a);
    box-shadow: 0 0 0 3px rgba(107, 142, 90, 0.15);
}

#res-email::placeholder {
    color: #bbb;
}

#res-email:invalid:not(:placeholder-shown) {
    border-color: #e57373;
}

/* ===============================================
   Reservation UI polish (scrollbar / legend / spacing)
   =============================================== */
.reservation-left-pane,
.reservation-right-pane,
.reservation-right-pane .timeslot-grid,
.reservation-left-pane .res-selected-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 142, 90, 0.75) rgba(107, 142, 90, 0.16);
}

.reservation-left-pane::-webkit-scrollbar,
.reservation-right-pane::-webkit-scrollbar,
.reservation-right-pane .timeslot-grid::-webkit-scrollbar,
.reservation-left-pane .res-selected-list::-webkit-scrollbar {
    width: 12px;
}

.reservation-left-pane::-webkit-scrollbar-track,
.reservation-right-pane::-webkit-scrollbar-track,
.reservation-right-pane .timeslot-grid::-webkit-scrollbar-track,
.reservation-left-pane .res-selected-list::-webkit-scrollbar-track {
    background: rgba(107, 142, 90, 0.14);
    border-radius: 999px;
    margin: 10px 0;
}

.reservation-left-pane::-webkit-scrollbar-thumb,
.reservation-right-pane::-webkit-scrollbar-thumb,
.reservation-right-pane .timeslot-grid::-webkit-scrollbar-thumb,
.reservation-left-pane .res-selected-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a7c493 0%, #6b8e5a 100%);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.reservation-left-pane::-webkit-scrollbar-thumb:hover,
.reservation-right-pane::-webkit-scrollbar-thumb:hover,
.reservation-right-pane .timeslot-grid::-webkit-scrollbar-thumb:hover,
.reservation-left-pane .res-selected-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8eaf77 0%, #57764a 100%);
}

.reservation-left-pane .reservation-panel {
    padding: 18px 22px 16px;
    gap: 14px;
}

.reservation-left-pane .res-panel-title {
    margin: 0 0 -4px;
    /* Reduce space below title */
}

.reservation-left-pane .res-panel-section {
    gap: 8px;
    margin-bottom: 0;
}

.reservation-left-pane .res-calendar-inline {
    padding: 10px 12px;
    margin-bottom: 8px;
    /* Add space between calendar and email */
}

/* Calendar Day Micro-interaction */
.flatpickr-day:not(.selected):not(.flatpickr-disabled):not(.prevMonthDay):not(.nextMonthDay):hover {
    background: rgba(107, 142, 90, 0.1) !important;
    border-color: rgba(107, 142, 90, 0.3) !important;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.reservation-left-pane .res-panel-selection {
    padding: 10px 10px 8px;
    border: 1px solid rgba(107, 142, 90, 0.18);
}

.reservation-left-pane .res-panel-action {
    margin-top: 4px;
    padding: 14px;
}

.reservation-right-pane .res-panel-legend {
    gap: 16px;
}

/* Legend items animation delay logic */
.legend-item:nth-child(1) .color-box {
    animation-delay: 0.1s;
}

.legend-item:nth-child(2) .color-box {
    animation-delay: 0.2s;
}

.legend-item:nth-child(3) .color-box {
    animation-delay: 0.3s;
}

.reservation-right-pane .legend-item {
    font-size: 0.84rem;
    font-weight: 600;
    color: #4f5d3f;
    display: flex;
    align-items: center;
}

.reservation-right-pane .color-box {
    width: 14px !important;
    height: 14px !important;
    margin-right: 8px;
    border-radius: 50% !important;
    /* Make perfectly round */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    /* Slight shadow for depth */
    border: 2px solid transparent !important;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
    /* Pop animation */
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.reservation-right-pane .color-box.available {
    background: #ffffff;
    border-color: #b7c8ae;
}

.reservation-right-pane .color-box.selected {
    background: #80b56b;
    border-color: #5f924d;
}

.reservation-right-pane .color-box.booked {
    background: #d6dcdf;
    border-color: #b8c1c5;
}

.reservation-right-pane .timeslot-status {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: 2px solid #d8e0d1;
    background: #fff;
    color: transparent;
    border-radius: 50% !important;
    /* Ensure it's explicitly round for the animation */
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex !important;
    /* Centering checkmark */
    align-items: center !important;
    justify-content: center !important;
}

.reservation-right-pane .timeslot-row.selected .timeslot-status {
    background: var(--primary-color, #6b8e5a);
    border-color: var(--primary-color, #6b8e5a);
    color: #fff;
    animation: bounceCheck 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceCheck {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

.reservation-right-pane .timeslot-row.selected .timeslot-status::before {
    content: '\2713' !important;
    font-size: 1rem !important;
    font-weight: 900 !important;
    line-height: 1;
    display: block !important;
    /* For flex centering */
    animation: fadeInCheck 0.2s ease forwards;
}

@keyframes fadeInCheck {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .reservation-left-pane .reservation-panel {
        padding: 14px 12px 12px;
        gap: 12px;
    }

    .reservation-right-pane .timeslot-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px 16px;
    }

    .reservation-right-pane .timeslot-grid {
        padding: 14px;
    }
}