/* ================================================================
   OSINT Search Platform - スタイルシート
   ================================================================ */

/* --- リセット & 変数 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:           #0b0b13;
    --surface:      #11111e;
    --surface2:     #181828;
    --border:       #22223a;
    --border-light: #2e2e50;

    --accent:       #6c63ff;
    --accent-dim:   rgba(108, 99, 255, 0.18);
    --accent-glow:  rgba(108, 99, 255, 0.35);

    --success:      #00e676;
    --success-dim:  rgba(0, 230, 118, 0.15);
    --warning:      #ffab00;
    --error:        #ff5252;
    --error-dim:    rgba(255, 82, 82, 0.15);

    --text:         #dde0f0;
    --muted:        #6b6b8a;
    --muted2:       #44446a;

    --sherlock:     #4a9eff;
    --sherlock-dim: rgba(74, 158, 255, 0.15);
    --holehe:       #ff6bbd;
    --holehe-dim:   rgba(255, 107, 189, 0.15);
    --ignorant:     #ffd166;
    --ignorant-dim: rgba(255, 209, 102, 0.15);

    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 4px 24px rgba(0,0,0,0.5);
}

/* --- ベース --- */
html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', 'Noto Sans JP', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* ================================================================
   ヘッダー
   ================================================================ */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-dim), transparent 70%);
    pointer-events: none;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1.5px;
}

.logo-icon {
    color: var(--accent);
    font-size: 1.6rem;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 12px var(--accent); }
    50%       { opacity: 0.7; text-shadow: none; }
}

.accent { color: var(--accent); }

.subtitle {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.875rem;
    letter-spacing: 0.3px;
}

/* ================================================================
   メインコンテンツ
   ================================================================ */
main {
    flex: 1;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

/* ================================================================
   タブ
   ================================================================ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--surface2);
    color: var(--text);
}

.tab-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 16px var(--accent-glow);
    font-weight: 700;
}

.tab-icon { font-size: 1rem; }

/* ================================================================
   タブコンテンツ
   ================================================================ */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ================================================================
   検索カード
   ================================================================ */
.search-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

/* ツールバッジ */
.tool-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    border: 1px solid;
}

.tool-badge.sherlock {
    color: var(--sherlock);
    background: var(--sherlock-dim);
    border-color: var(--sherlock);
}
.tool-badge.holehe {
    color: var(--holehe);
    background: var(--holehe-dim);
    border-color: var(--holehe);
}
.tool-badge.ignorant {
    color: var(--ignorant);
    background: var(--ignorant-dim);
    border-color: var(--ignorant);
}

.tool-desc {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* 検索フォーム */
.search-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-icon {
    padding: 0 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    user-select: none;
    flex-shrink: 0;
}

.input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.85rem 0.75rem 0.85rem 0;
    color: var(--text);
    font-size: 1rem;
    width: 100%;
}

.input-wrap input::placeholder { color: var(--muted2); }

/* 電話番号フォーム */
.phone-form { flex-wrap: wrap; }

.phone-inputs {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    min-width: 0;
}

.country-code-wrap {
    display: flex;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0 0.5rem;
    width: 90px;
    flex-shrink: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.country-code-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.country-code-wrap .input-icon {
    color: var(--muted);
    font-size: 1rem;
    padding: 0 0.3rem 0 0.1rem;
}

.country-code-wrap input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1rem;
    width: 100%;
    padding: 0.85rem 0;
}

.phone-num-wrap { flex: 1; }

.hint {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.8rem;
    width: 100%;
}

/* 検索ボタン */
.search-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-btn:hover {
    background: #7c74ff;
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.search-btn:active { transform: translateY(0); }
.search-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ================================================================
   ローディング
   ================================================================ */
.loading-box {
    margin-top: 1.5rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 0 auto 1.25rem;
}

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

.loading-msg {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.loading-detail {
    color: var(--muted);
    font-size: 0.875rem;
    word-break: break-all;
}

/* ================================================================
   結果表示
   ================================================================ */
.results-area {
    margin-top: 1.5rem;
}

/* 結果ヘッダー */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-title {
    font-weight: 700;
    font-size: 1rem;
}

.count-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    border: 1px solid;
}

.count-badge.found {
    color: var(--success);
    background: var(--success-dim);
    border-color: var(--success);
}

.count-badge.zero {
    color: var(--muted);
    background: transparent;
    border-color: var(--muted2);
}

/* 結果グリッド */
.results-grid {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

/* 結果アイテム */
.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--surface2); }
.result-item.dim { opacity: 0.4; }

.result-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface2);
}

.result-icon.found-icon {
    background: var(--success-dim);
    border-color: rgba(0, 230, 118, 0.4);
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-url {
    display: block;
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.result-url:hover { text-decoration: underline; }

.result-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.15rem;
    word-break: break-all;
}

.found-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    color: var(--success);
    background: var(--success-dim);
    border: 1px solid rgba(0, 230, 118, 0.4);
    flex-shrink: 0;
}

.rate-limit-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    color: var(--warning);
    background: rgba(255, 171, 0, 0.12);
    border: 1px solid rgba(255, 171, 0, 0.4);
    flex-shrink: 0;
}

/* 結果なし */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--muted);
}

.no-results .big-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

/* エラー表示 */
.error-box {
    margin-top: 1.5rem;
    background: var(--error-dim);
    border: 1px solid rgba(255, 82, 82, 0.4);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    color: var(--error);
    font-size: 0.9rem;
}

.error-box pre {
    margin-top: 0.75rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    white-space: pre-wrap;
    word-break: break-all;
    background: rgba(0,0,0,0.3);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

/* ================================================================
   フッター
   ================================================================ */
footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.8;
}

.footer-tools { margin-top: 0.25rem; }
.sherlock-color { color: var(--sherlock); font-weight: 600; }
.holehe-color   { color: var(--holehe);   font-weight: 600; }
.ignorant-color { color: var(--ignorant); font-weight: 600; }

/* ================================================================
   レスポンシブ
   ================================================================ */
@media (max-width: 640px) {
    .tabs { flex-direction: column; gap: 2px; }
    .tab-btn { justify-content: flex-start; padding: 0.6rem 1rem; }
    .search-card { padding: 1.25rem; }
    .search-form { flex-direction: column; align-items: stretch; }
    .search-btn { justify-content: center; width: 100%; }
    .phone-inputs { flex-direction: column; }
    .country-code-wrap { width: 100%; }
    .results-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
    .logo { font-size: 1.5rem; }
    header { padding: 1.25rem 1rem 1rem; }
}
