/* ===================================================
   BUSSET Bridge UI - 店舗スマホ用 CSS
   PHP版店舗画面の構造・レスポンシブ挙動を完全再現
   =================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
}

/* ===== PC版サイドメニュー ===== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: #203864;
    color: white;
    z-index: 1000;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    background: #203864;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header img {
    max-width: 95%;
    height: auto;
    max-height: 120px;
}

/* ログイン情報表示 */
.login-info {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #203864;
}

.store-id {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.store-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.menu-item {
    margin: 0;
}

.menu-link {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #3498db;
}

.menu-link.active {
    background: rgba(52, 152, 219, 0.3);
    border-left-color: #3498db;
}

/* サイドバー下部ロゴ */
.sidebar-footer {
    position: relative;
    width: 100%;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    z-index: 1100;
}

.logout-link {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.logout-link:hover {
    color: #e74c3c;
}

.sidebar-footer a {
    display: block;
    text-decoration: none;
}

.sidebar-footer img {
    max-width: 95%;
    height: auto;
    max-height: 80px;
    transition: opacity 0.3s ease;
}

.sidebar-footer a:hover img {
    opacity: 0.8;
}

/* コピーライト表示 */
.copyright {
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 20px 20px;
}

/* サイドバーのコンテンツ全体をフレックスボックス化 */
.sidebar-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease;
}

.sidebar-main {
    flex: 1;
}

/* ===== メインコンテンツエリア ===== */

.main-content {
    margin-left: 250px;
    min-height: 100vh;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

/* ===== スマホ版ボトムメニュー ===== */

.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: #203864;
    color: white;
    display: none;
    z-index: 1000;
    padding: 10px;
}

.bottom-menu-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.bottom-menu-logo {
    flex: 1;
    text-align: left;
}

.bottom-menu-logo a {
    display: block;
    text-decoration: none;
}

.bottom-menu-logo img {
    max-height: 45px;
    max-width: calc(100% - 80px);
    height: auto;
    transition: opacity 0.3s ease;
}

.bottom-menu-logo a:hover img {
    opacity: 0.8;
}

.menu-toggle {
    background: #3498db;
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 60px;
}

.menu-toggle:hover {
    background: #2980b9;
}

/* ===== モーダルメニュー ===== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
}

.modal-menu {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -20%);
    background: white;
    border-radius: 10px;
    padding: 0;
    max-width: 90%;
    min-width: 280px;
    max-height: 70%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #203864;
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.modal-menu-item {
    border-bottom: 1px solid #eee;
}

.modal-menu-item:last-child {
    border-bottom: none;
}

.modal-menu-link {
    display: block;
    padding: 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
    font-size: 16px;
}

.modal-menu-link:hover {
    background: #f8f9fa;
}

.modal-logout {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.modal-logout a {
    color: #e74c3c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.modal-logout a:hover {
    color: #c0392b;
}

/* ===== レスポンシブ設定 ===== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 20px 5px 85px; /* 下 85px = ボトムメニュー 65px + 余白 */
    }

    .bottom-menu {
        display: block;
    }
}

@media (min-width: 769px) {
    .bottom-menu {
        display: none !important;
    }

    .modal-overlay {
        display: none !important;
    }
}

/* ===== アニメーション ===== */

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -30%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -20%);
    }
}

/* ===== テスト用 店舗リンク（サイドバー内） ===== */

.test-store-section {
    margin: 10px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 8px;
}

.test-store-label {
    padding: 8px 20px 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.test-store-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.test-store-list li {
    margin: 0;
}

.test-store-link {
    display: block;
    padding: 9px 20px 9px 28px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
}

.test-store-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: #3498db;
}

.test-store-link.active {
    background: rgba(52, 152, 219, 0.25);
    color: white;
    border-left-color: #3498db;
    font-weight: 600;
}

/* ===== タスク一覧 スタイル ===== */

.task-list-header {
    background: white;
    border-radius: 10px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-list-header h1 {
    font-size: 22px;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 6px;
}

.task-count-badge {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.task-list-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.task-hide-completed-btn {
    padding: 6px 12px;
    border: 1.5px solid #a7e3b8;
    border-radius: 20px;
    background: #eafbf0;
    color: #2c7a4b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-hide-completed-btn-active {
    background: #34495e;
    color: white;
    border-color: #34495e;
}

.task-card {
    background: white;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #3498db;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    display: block;
    color: inherit;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.task-card.type-tokubai-start  { border-left-color: #f97316; background: #fff3e0; }
.task-card.type-tokubai-end    { border-left-color: #e91e63; background: #fce4ec; }
.task-card.type-shohin         { border-left-color: #27ae60; background: #e8f5e9; }
.task-card.type-haiban         { border-left-color: #7c3aed; background: #f3e5f5; }
.task-card.type-zaiko          { border-left-color: #2196f3; background: #e3f2fd; }
.task-card.type-photo          { border-left-color: #db2777; background: #fdf2f8; }
.task-card.type-naiyou         { border-left-color: #d97706; background: #fffbeb; }
.task-card.type-shinki-keizoku { border-left-color: #1d4ed8; background: #eff6ff; }

.task-card.type-tokubai-start  .task-type-badge { background: #f97316; color: #fff; }
.task-card.type-tokubai-end    .task-type-badge { background: #e91e63; color: #fff; }
.task-card.type-shohin         .task-type-badge { background: #27ae60; color: #fff; }
.task-card.type-haiban         .task-type-badge { background: #7c3aed; color: #fff; }
.task-card.type-zaiko          .task-type-badge { background: #2196f3; color: #fff; }
.task-card.type-photo          .task-type-badge { background: #db2777; color: #fff; }
.task-card.type-naiyou         .task-type-badge { background: #d97706; color: #fff; }
.task-card.type-shinki-keizoku .task-type-badge { background: #1d4ed8; color: #fff; }

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.task-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    background: #ecf0f1;
    color: #555;
    white-space: nowrap;
}

.task-number {
    font-size: 11px;
    color: #95a5a6;
}

.task-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #7f8c8d;
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.print-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.print-status.status-done {
    background: #d5f5e3;
    color: #1e8449;
}

.print-status.status-pending {
    background: #fdebd0;
    color: #d35400;
}

/* ===== タスク詳細 スタイル ===== */

.task-detail-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.task-detail-section h2 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ecf0f1;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-label {
    font-size: 11px;
    color: #95a5a6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
}

.detail-value.empty {
    color: #bdc3c7;
    font-style: italic;
    font-weight: 400;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: #2980b9;
    color: white;
}

.back-btn-bar {
    position: sticky;
    top: 0;
    z-index: 150;
    background: #f0f4f8;
    padding: 8px 0;
    margin-bottom: 10px;
}

.pop-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pop-info-table th,
.pop-info-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.pop-info-table th {
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
    font-size: 12px;
}

/* ===== ローディング / エラー ===== */

.loading-container {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-container {
    background: #fdf0f0;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    padding: 20px;
    color: #721c24;
    margin: 20px 0;
}

/* ===== スマホ最適化 ===== */

@media (max-width: 480px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .task-list-header {
        padding: 14px 16px;
        gap: 8px;
    }

    .task-list-header h1 {
        font-size: 18px;
    }

    .task-hide-completed-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}
