/* ============================================
   AppAtlas - 一般公開用スタイル
   モバイルファースト設計
   ============================================ */

/* ---------- リセット & ベース ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- ヘッダー ---------- */
.app-header {
    background: #ffffff;
    border-bottom: 2px solid #e2e8f0;
    padding: 16px 24px;
    flex-shrink: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.app-header h1 small {
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
    margin-left: 8px;
}

.app-header p {
    color: #64748b;
    font-size: 14px;
}

/* ---------- ヘッダーアクション ---------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login {
    display: inline-block;
    padding: 6px 16px;
    background: #2563eb;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #1d4ed8;
}

.btn-logout {
    display: inline-block;
    padding: 4px 14px;
    background: #ef4444;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 8px;
    background: #f1f5f9;
    border-radius: 30px;
}

.user-avatar-text {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-name {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

/* ---------- メインコンテンツ ---------- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
    width: 100%;
}

/* ---------- フラッシュメッセージ ---------- */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 10px 16px;
    border-radius: 6px;
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
    margin-bottom: 6px;
}

/* ---------- ページヘッダー ---------- */
.page-header {
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: 22px;
    font-weight: 600;
}

/* ---------- カードグリッド ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* ---------- カード ---------- */
.card {
    background: #ffffff;
    padding: 20px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: #94a3b8;
}

.card-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
    line-height: 1;
}

.card-icon img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.card .description {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card .badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

/* ---------- 空の状態 ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 22px;
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-state p {
    color: #64748b;
    font-size: 16px;
}

.btn-admin {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 28px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-admin:hover {
    background: #1d4ed8;
}

/* ---------- アプリ詳細 ---------- */
.app-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.app-detail-header .app-icon {
    font-size: 64px;
}
.app-detail-header .app-icon img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
}

.app-detail-header .app-info h1 {
    font-size: 28px;
    margin: 0;
}
.app-detail-header .app-info p {
    color: #64748b;
    margin: 4px 0 0 0;
}

.btn-back {
    display: inline-block;
    padding: 6px 16px;
    background: #e2e8f0;
    color: #1e293b;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    margin-left: auto;
}
.btn-back:hover {
    background: #cbd5e1;
}

/* ---------- 機能一覧テーブル ---------- */
.features-section {
    margin: 32px 0;
}
.features-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.features-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.features-table th {
    background: #f1f5f9;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #0f172a;
}

.features-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.features-table tr:last-child td {
    border-bottom: none;
}

.features-table .category {
    font-weight: 500;
    width: 30%;
}
.features-table .items .tag {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin: 2px 4px 2px 0;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    background: #f8fafc;
    border-radius: 12px;
}

/* ---------- 画面ギャラリー ---------- */
.gallery-section {
    margin: 32px 0;
}
.gallery-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.screen-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.gallery-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #f1f5f9;
}

.gallery-item .no-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 14px;
}

.gallery-item .screen-title {
    display: block;
    padding: 10px 12px;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
}

/* ---------- 画面詳細 ---------- */
.screen-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.screen-detail-header h1 {
    font-size: 24px;
    margin: 0;
}

.screen-viewer {
    max-width: 900px;
    margin: 24px auto;
    position: relative;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.screen-viewer img {
    width: 100%;
    height: auto;
    display: block;
}

.screen-viewer .no-image-large {
    padding: 80px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 20px;
}

/* マーカーオーバーレイ */
.marker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.marker-dot-public {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 12px rgba(239,68,68,0.5);
    transition: transform 0.2s;
    border: 2px solid white;
    z-index: 10;
}

.marker-dot-public:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.marker-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    max-width: 300px;
    white-space: normal;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.marker-dot-public:hover .marker-tooltip {
    display: block;
}

.marker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* ---------- マーカー一覧（画面詳細） ---------- */
.marker-list-section {
    max-width: 900px;
    margin: 24px auto;
}
.marker-list-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.marker-list {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.marker-list .marker-item {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.marker-list .marker-item:last-child {
    border-bottom: none;
}

.marker-list .marker-num {
    font-weight: 700;
    color: #ef4444;
    min-width: 36px;
    font-size: 16px;
}
.marker-list .marker-desc {
    color: #1e293b;
    font-size: 15px;
}
.marker-list .marker-empty {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
}

/* ---------- フッター ---------- */
.app-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: auto;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 640px) {
    .app-header h1 { font-size: 20px; }
    .app-header p { font-size: 12px; }
    .app-detail-header .app-info h1 { font-size: 22px; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .screen-gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .features-table { font-size: 14px; }
    .marker-dot-public { width: 30px; height: 30px; font-size: 12px; }
    .user-name { font-size: 13px; }
    .btn-login, .btn-logout { font-size: 12px; padding: 4px 12px; }
}

/* ---------- ダークモード ---------- */
@media (prefers-color-scheme: dark) {
    body { background: #0f172a; color: #e2e8f0; }
    .app-header { background: #1e293b; border-color: #334155; }
    .app-header h1 { color: #f1f5f9; }
    .app-header p { color: #94a3b8; }
    .card { background: #1e293b; border-color: #334155; }
    .card:hover { border-color: #64748b; }
    .card h3 { color: #f1f5f9; }
    .card .description { color: #94a3b8; }
    .card .badge { background: #1e3a5f; color: #60a5fa; }
    .features-table { background: #1e293b; }
    .features-table th { background: #0f172a; color: #f1f5f9; }
    .features-table td { border-color: #334155; }
    .features-table .items .tag { background: #1e3a5f; color: #60a5fa; }
    .gallery-item { background: #1e293b; border-color: #334155; }
    .gallery-item .no-image { background: #0f172a; }
    .screen-viewer { background: #0f172a; border-color: #334155; }
    .marker-list { background: #1e293b; border-color: #334155; }
    .marker-list .marker-item { border-color: #334155; }
    .marker-list .marker-desc { color: #e2e8f0; }
    .marker-tooltip { background: #0f172a; }
    .marker-tooltip::after { border-top-color: #0f172a; }
    .empty-state h2 { color: #f1f5f9; }
    .empty-state p { color: #94a3b8; }
    .btn-back { background: #1e293b; color: #e2e8f0; }
    .btn-back:hover { background: #334155; }
    .app-footer { background: #1e293b; border-color: #334155; }
    .user-info { background: #0f172a; }
    .user-name { color: #e2e8f0; }
    .empty-message { background: #1e293b; }
    .flash-message { background: #1e3a5f; color: #60a5fa; border-color: #2563eb; }
}

/* ============================================
   AppAtlas - 一般公開用スタイル
   モバイルファースト設計
   ============================================ */

/* ---------- リセット & ベース ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- ヘッダー ---------- */
.app-header {
    background: #ffffff;
    border-bottom: 2px solid #e2e8f0;
    padding: 16px 24px;
    flex-shrink: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.app-header h1 small {
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
    margin-left: 8px;
}

.app-header p {
    color: #64748b;
    font-size: 14px;
}

/* ---------- ヘッダーアクション ---------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login {
    display: inline-block;
    padding: 6px 16px;
    background: #2563eb;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #1d4ed8;
}

.btn-logout {
    display: inline-block;
    padding: 4px 14px;
    background: #ef4444;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
}

.btn-inquiry {
    display: inline-block;
    padding: 4px 14px;
    background: #8b5cf6;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-inquiry:hover {
    background: #7c3aed;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 8px;
    background: #f1f5f9;
    border-radius: 30px;
}

.user-avatar-text {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-name {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

.badge-admin {
    font-size: 11px;
    background: #2563eb;
    color: white;
    padding: 1px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.btn-admin-link {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.btn-admin-link:hover {
    text-decoration: underline;
}

/* ---------- メインコンテンツ ---------- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
    width: 100%;
}

/* ---------- フラッシュメッセージ ---------- */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 10px 16px;
    border-radius: 6px;
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
    margin-bottom: 6px;
}

/* ---------- ページヘッダー ---------- */
.page-header {
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: 22px;
    font-weight: 600;
}

/* ---------- カードグリッド ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ---------- 🔥 カード（スプラッシュ対応） ---------- */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    padding: 0 16px 16px 16px;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: #94a3b8;
}

/* スプラッシュ画像 */
.card-splash {
    width: calc(100% + 32px);
    height: 150px;
    margin: 0 -16px 8px -16px;
    overflow: hidden;
    background: #f1f5f9;
}

.card-splash .splash-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-splash .splash-image {
    transform: scale(1.03);
}

/* アイコン（スプラッシュがない場合の代替） */
.card-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 70px;
    margin-bottom: 8px;
}

.card-icon-wrapper .card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.card-icon-wrapper .card-icon-emoji {
    font-size: 48px;
    line-height: 1;
}

/* スプラッシュがない場合は従来のパディング */
.card:not(:has(.card-splash)) {
    padding: 20px 16px;
}

.card:not(:has(.card-splash)) .card-icon-wrapper {
    height: 60px;
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin: 4px 0 4px 0;
}

.card .description {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card .badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

/* ---------- 空の状態 ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 22px;
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-state p {
    color: #64748b;
    font-size: 16px;
}

.btn-admin {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 28px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-admin:hover {
    background: #1d4ed8;
}

/* ---------- アプリ詳細 ---------- */
.app-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.app-detail-header .app-icon {
    font-size: 64px;
}
.app-detail-header .app-icon img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
}

.app-detail-header .app-info h1 {
    font-size: 28px;
    margin: 0;
}
.app-detail-header .app-info p {
    color: #64748b;
    margin: 4px 0 0 0;
}

.btn-back {
    display: inline-block;
    padding: 6px 16px;
    background: #e2e8f0;
    color: #1e293b;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    margin-left: auto;
}
.btn-back:hover {
    background: #cbd5e1;
}

/* ---------- 🔥 アプリ詳細スプラッシュ ---------- */
.app-splash-section {
    margin: 20px 0 24px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.app-splash-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

/* ---------- 機能一覧テーブル ---------- */
.features-section {
    margin: 32px 0;
}
.features-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.features-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.features-table th {
    background: #f1f5f9;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #0f172a;
}

.features-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.features-table tr:last-child td {
    border-bottom: none;
}

.features-table .category {
    font-weight: 500;
    width: 30%;
}
.features-table .items .tag {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin: 2px 4px 2px 0;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    background: #f8fafc;
    border-radius: 12px;
}

/* ---------- 画面ギャラリー ---------- */
.gallery-section {
    margin: 32px 0;
}
.gallery-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.screen-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.gallery-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #f1f5f9;
}

.gallery-item .no-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 14px;
}

.gallery-item .screen-title {
    display: block;
    padding: 10px 12px;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
}

/* ---------- 画面詳細 ---------- */
.screen-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.screen-detail-header h1 {
    font-size: 24px;
    margin: 0;
}

.screen-viewer {
    max-width: 900px;
    margin: 24px auto;
    position: relative;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.screen-viewer img {
    width: 100%;
    height: auto;
    display: block;
}

.screen-viewer .no-image-large {
    padding: 80px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 20px;
}

/* マーカーオーバーレイ */
.marker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.marker-dot-public {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 12px rgba(239,68,68,0.5);
    transition: transform 0.2s;
    border: 2px solid white;
    z-index: 10;
}

.marker-dot-public:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.marker-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    max-width: 300px;
    white-space: normal;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.marker-dot-public:hover .marker-tooltip {
    display: block;
}

.marker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* ---------- マーカー一覧（画面詳細） ---------- */
.marker-list-section {
    max-width: 900px;
    margin: 24px auto;
}
.marker-list-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.marker-list {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.marker-list .marker-item {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.marker-list .marker-item:last-child {
    border-bottom: none;
}

.marker-list .marker-num {
    font-weight: 700;
    color: #ef4444;
    min-width: 36px;
    font-size: 16px;
}
.marker-list .marker-desc {
    color: #1e293b;
    font-size: 15px;
}
.marker-list .marker-empty {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
}

/* ---------- フッター ---------- */
.app-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: auto;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 640px) {
    .app-header h1 { font-size: 20px; }
    .app-header p { font-size: 12px; }
    .app-detail-header .app-info h1 { font-size: 22px; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .card-splash { height: 120px; }
    .screen-gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .features-table { font-size: 14px; }
    .marker-dot-public { width: 30px; height: 30px; font-size: 12px; }
    .user-name { font-size: 13px; }
    .btn-login, .btn-logout { font-size: 12px; padding: 4px 12px; }
}

/* ---------- ダークモード ---------- */
@media (prefers-color-scheme: dark) {
    body { background: #0f172a; color: #e2e8f0; }
    .app-header { background: #1e293b; border-color: #334155; }
    .app-header h1 { color: #f1f5f9; }
    .app-header p { color: #94a3b8; }
    .card { background: #1e293b; border-color: #334155; }
    .card:hover { border-color: #64748b; }
    .card h3 { color: #f1f5f9; }
    .card .description { color: #94a3b8; }
    .card .badge { background: #1e3a5f; color: #60a5fa; }
    .card-splash { background: #0f172a; }
    .features-table { background: #1e293b; }
    .features-table th { background: #0f172a; color: #f1f5f9; }
    .features-table td { border-color: #334155; }
    .features-table .items .tag { background: #1e3a5f; color: #60a5fa; }
    .gallery-item { background: #1e293b; border-color: #334155; }
    .gallery-item .no-image { background: #0f172a; }
    .screen-viewer { background: #0f172a; border-color: #334155; }
    .marker-list { background: #1e293b; border-color: #334155; }
    .marker-list .marker-item { border-color: #334155; }
    .marker-list .marker-desc { color: #e2e8f0; }
    .marker-tooltip { background: #0f172a; }
    .marker-tooltip::after { border-top-color: #0f172a; }
    .empty-state h2 { color: #f1f5f9; }
    .empty-state p { color: #94a3b8; }
    .btn-back { background: #1e293b; color: #e2e8f0; }
    .btn-back:hover { background: #334155; }
    .app-footer { background: #1e293b; border-color: #334155; }
    .user-info { background: #0f172a; }
    .user-name { color: #e2e8f0; }
    .empty-message { background: #1e293b; }
    .flash-message { background: #1e3a5f; color: #60a5fa; border-color: #2563eb; }
    .app-splash-section { border-color: #334155; background: #0f172a; }
}