/* ==========================================================================
   Base & Reset
   ========================================================================== */
   :root {
    --bg-color: #050505;
    --card-bg: #111111;
    --text-main: #ffffff;
    --text-muted: #dddddd;
    --text-light: #999999;
    --accent-color: #e50914;
    --accent-hover: #ff3333;
    --border-color: #333333;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --radius-md: 0px;
    --radius-lg: 0px;
    --radius-full: 0px;
    --font-family: 'Inter', 'Helvetica Neue', 'Arial', sans-serif;
    --transition-fast: 0.2s ease-out;
    --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */
.app-container {
    max-width: 600px; /* Mobile-first, but looks okay on PC */
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-color);
    position: relative;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    text-align: center;
    padding: 40px 20px 30px;
    background: linear-gradient(to bottom, #1a1a1a, var(--bg-color));
    border-bottom: 1px solid var(--border-color);
}

.hero-image-floated {
    float: left;
    width: 90px;
    height: 90px;
    object-fit: cover;
    margin: 0 16px 8px 0;
    filter: grayscale(100%);
    -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 95%);
    mask-image: linear-gradient(135deg, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 95%);
}

.hero-greeting {
    font-size: 14px;
    color: var(--text-muted);
    text-align: left;
    background: var(--card-bg);
    padding: 16px;
    border-radius: 0;
    box-shadow: var(--shadow-sm);
    margin: 16px auto;
    max-width: 90%;
    line-height: 1.7;
}
.hero-greeting p {
    margin-bottom: 12px;
}
.hero-greeting p:last-child {
    margin-bottom: 0;
}

.hero-english {
    font-size: 12px;
    color: var(--text-light);
    background: #222222;
    padding: 12px;
    border-radius: 0;
    display: inline-block;
    max-width: 90%;
    line-height: 1.5;
}

/* ==========================================================================
   Top News
   ========================================================================== */
.top-news {
    padding: 24px 20px 0;
}
.top-news-card {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Menu Cards Grid
   ========================================================================== */
.menu-grid {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 60px;
}

.menu-card {
    display: flex;
    align-items: center;
    background: transparent;
    padding: 16px 20px;
    border: none;
    transition: transform var(--transition-fast);
    text-align: left;
    outline: none;
    transform: translateX(0);
}

.menu-card:hover, .menu-card:focus-visible {
    transform: translateX(8px);
}

.menu-card:active {
    transform: translateY(0);
}

.card-icon {
    font-size: 24px;
    margin-right: 16px;
    background: transparent;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    font-family: 'Bodoni Moda', 'Bodoni MT', 'Times New Roman', serif;
}

.card-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.card-arrow {
    color: var(--text-light);
    margin-left: 12px;
}

/* ==========================================================================
   Modal Overlay & Panel
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7); /* semi-transparent black */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Bottom sheet align by default on mobile */
    align-items: center;

    /* Animation initial limits */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.modal-panel {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh; /* max height so it doesn't cover top */
    border-radius: 0; /* rounded top */
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

.modal-overlay.is-active .modal-panel {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    border-radius: 0;
    z-index: 10;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 0;
    background: #222222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    padding-bottom: 4px; /* ×文字の微妙な上下のズレを調整 */
    transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
    background: #333333;
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
}

/* AIチャット時はモーダル自体のスクロールを止める */
.modal-panel[data-mode="ai-chat"] .modal-body {
    overflow: hidden;
    padding-bottom: 24px;
}

/* Modal Desktop Adjustments */
@media (min-width: 641px) {
    .modal-overlay {
        justify-content: center; /* Center horizontally/vertically on PC */
        padding: 40px;
    }
    .modal-panel {
        border-radius: 0;
        max-height: 85vh;
        transform: scale(0.95);
        opacity: 0;
    }
    .modal-overlay.is-active .modal-panel {
        transform: scale(1);
        opacity: 1;
    }
    .modal-header {
        border-radius: 0;
    }
}

/* ==========================================================================
   Content Details (Inside Modals)
   ========================================================================== */
.section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: var(--text-main);
    border-left: 4px solid var(--accent-color);
    padding-left: 8px;
}

.attention-text {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* Profile specific */
.profile-basic {
    background: var(--bg-color);
    padding: 16px;
    border-radius: 0;
    margin-bottom: 24px;
}
.info-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
}
.info-row:last-child { margin-bottom: 0; }
.info-label {
    font-weight: 600;
    width: 80px;
    color: var(--text-muted);
}
.info-val {
    flex: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 24px;
}
.data-table th, .data-table td {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}
.data-table th {
    background: var(--bg-color);
    width: 35%;
    font-weight: 600;
    color: var(--text-muted);
}
.data-table td {
    background: var(--card-bg);
}

/* Buttons */
.primary-btn {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 12px 24px;
    border-radius: 0;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    border: 1px solid var(--accent-color);
    box-shadow: none;
    transform: translateY(0);
    transition: all var(--transition-fast);
}
.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-4px);
    box-shadow: 4px 4px 0 var(--text-main);
    border-color: var(--accent-hover);
    color: white;
}
.primary-btn:disabled {
    background: var(--text-light);
    border-color: var(--text-light);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.center-btn-wrap {
    text-align: center;
    margin-top: 20px;
}

/* News */
.news-card {
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 24px;
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
}
.news-card p {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.news-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 0;
}
.news-headline {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
}

/* Link List */
.link-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.link-card-btn {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    transition: all var(--transition-fast);
    background: var(--card-bg);
    transform: translateY(0);
}
.link-card-btn:hover {
    transform: translateY(-4px);
    box-shadow: 4px 4px 0 var(--accent-color);
    border-color: var(--accent-color);
    background: var(--bg-color);
}
.link-card-btn.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: default;
}
.link-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}
.x-icon { color: #fff; }
.shop-icon { font-size: 20px; }
.ai-icon { font-size: 20px; }
.link-info {
    display: flex;
    flex-direction: column;
}
.link-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
}
.link-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Manager Page Info */
.manager-card {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 0;
    margin-bottom: 16px;
}
.manager-card p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==========================================================================
   Chat Interface Details
   ========================================================================== */
.chat-section {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.chat-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 0 4px;
}
.chat-wrapper {
    background: var(--bg-color);
    border-radius: 0;
    border: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

/* モーダルがAIチャットの時は画面いっぱいに伸ばす */
.modal-panel[data-mode="ai-chat"] .chat-wrapper {
    flex: 1;
    height: auto;
    min-height: 0;
}
.chat-log {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 4px;
}
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}
.msg-ai {
    align-self: flex-start;
}
.msg-user {
    align-self: flex-end;
}
.msg-sender {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}
.msg-user .msg-sender {
    text-align: right;
}
.msg-bubble {
    padding: 12px 16px;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.msg-ai .msg-bubble {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-top-left-radius: 4px;
}
.msg-user .msg-bubble {
    background: var(--accent-color);
    color: #fff;
    border-top-right-radius: 4px;
}
.chat-input-area {
    display: flex;
    gap: 8px;
}
#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}
#chat-input:focus {
    border-color: var(--accent-color);
}
#chat-submit {
    padding: 12px 24px;
}

/* Typing Indicator Animation */
.typing-indicator span {
    animation: typing 1.4s infinite;
    animation-fill-mode: both;
    height: 4px;
    width: 4px;
    background: var(--text-muted);
    border-radius: 0;
    display: inline-block;
    margin: 0 1px;
}
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0% { opacity: 0.2; transform: translateY(0); }
    20% { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 0.2; transform: translateY(0); }
}

/* ==========================================================================
   Header & Sidebar Navigation
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}

.header-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-main);
    font-family: 'Bodoni Moda', 'Bodoni MT', 'Times New Roman', serif;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    transform: scale(1.05);
    color: var(--accent-color);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.sidebar-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.sidebar-panel {
    background: var(--bg-color);
    width: 85%;
    max-width: 400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
}

.sidebar-overlay.is-active .sidebar-panel {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 10;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Bodoni Moda', 'Bodoni MT', 'Times New Roman', serif;
}

.sidebar-close {
    width: 40px;
    height: 40px;
    border-radius: 0;
    background: #222222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    padding-bottom: 4px; /* ×文字の微妙な上下のズレを調整 */
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-close:hover {
    background: #444444;
    color: var(--text-main);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    text-align: center;
    padding: 32px 20px 24px;
    font-size: 11px;
    color: var(--text-light);
    font-family: 'Bodoni Moda', 'Bodoni MT', 'Times New Roman', serif;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Splash Screen
   ========================================================================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 3秒見せて、1.5秒かけてフェードアウトする */
    animation: fadeOutSplash 1.5s ease-in-out 3s forwards;
}

.splash-text {
    font-family: 'Bodoni Moda', 'Bodoni MT', 'Times New Roman', serif;
    color: #000000;
    text-align: center;
    opacity: 0;
    /* 0.5秒待って、2秒かけてゆっくりフェードイン */
    animation: fadeInSplashText 2s ease-out 0.5s forwards;
}

.splash-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.splash-subtitle {
    font-size: 15px;
    letter-spacing: 0.15em;
    font-weight: 400;
}

@keyframes fadeInSplashText {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutSplash {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

