/* カメラAPI・Web動作検証ツール スタイルシート */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --accent-hover: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
}

/* 全体コンテナ */
.verify-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 0.8rem 3rem;
    width: 100%;
}

/* ナビゲーションタブ */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 総合ステータス表示バー */
.status-summary-bar {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(8px);
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.status-pill .label {
    color: var(--text-muted);
}

/* バッジスタイル */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-inactive {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.badge-active {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-info {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

/* カード共通 */
.camera-card, .control-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.card-header-flex .card-title {
    margin-bottom: 0;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

/* カメラビューポート */
.camera-viewport-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 400px;
    background: #000000;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 1rem;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
}

.camera-placeholder .placeholder-icon {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.camera-placeholder .placeholder-sub {
    font-size: 0.8rem;
    margin-top: 0.3rem;
    opacity: 0.75;
}

/* カメラ動作中インジケータ */
.live-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 5;
    backdrop-filter: blur(4px);
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: blink-pulse 1.2s infinite;
}

@keyframes blink-pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* シャッターフラッシュ */
.shutter-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.1s ease-out;
}

.shutter-flash.flash-active {
    opacity: 0.7;
}

/* コントロールボタン共通 */
.control-row {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.three-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

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

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-accent {
    background: var(--accent);
    color: #ffffff;
}

.btn-accent:not(:disabled):hover {
    background: var(--accent-hover);
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

.btn-warning {
    background: #f59e0b;
    color: #ffffff;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    flex: none;
}

.full-width {
    width: 100%;
    margin-top: 0.8rem;
}

.header-btn-group {
    display: flex;
    gap: 0.4rem;
}

/* アラートボックス */
.alert-box {
    margin-top: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* セクションブロック */
.section-block {
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* 撮影間隔選択 */
.interval-selector-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.selector-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.radio-group {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.radio-label {
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* 統計グリッド */
.interval-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.stat-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.stat-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-all;
}

/* プレビュー画像 */
.preview-container {
    width: 100%;
    min-height: 180px;
    background: #000000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.preview-img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.preview-meta {
    margin-top: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.2rem;
}

.meta-row:last-child {
    margin-bottom: 0;
}

.meta-title {
    color: var(--text-muted);
}

/* ログコンソール */
.log-console-container {
    background: #0a0f1d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 260px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    -webkit-overflow-scrolling: touch;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
}

.log-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.log-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    white-space: nowrap;
}

.log-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.log-type-visibility {
    color: #818cf8;
}

.log-type-capture {
    color: #34d399;
}

.log-type-error {
    color: #f87171;
}

.log-type-warn {
    color: #fbbf24;
}

/* フッター */
.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* ユーティリティ */
.hidden {
    display: none !important;
}

/* レスポンシブ微調整 */
@media (max-width: 480px) {
    .verify-container {
        padding: 0.6rem 0.5rem 2rem;
    }
    .camera-card, .control-card {
        padding: 0.9rem;
    }
    .three-buttons {
        grid-template-columns: 1fr;
    }
    .interval-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    .status-summary-bar {
        flex-direction: column;
        gap: 0.3rem;
    }
}
