/*
 * Copyright (c) 2026 AIRISH LLC
 * All Rights Reserved.
 *
 * This source code is proprietary and confidential.
 * Use is permitted only with explicit authorization from AIRISH LLC.
 * See the LICENSE file for details.
 */

:root {
    --navy: #1a365d;
    --navy-light: #2c5282;
    --blue: #3182ce;
    --blue-light: #4299e1;
    --bg: #ffffff;
    --bg-alt: #f7fafc;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-muted: #718096;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(26, 54, 93, 0.08), 0 1px 2px rgba(26, 54, 93, 0.06);
    --shadow-md: 0 4px 12px rgba(26, 54, 93, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    color: var(--navy-light);
}

.app-container {
    max-width: 1140px;
}

/* Header */
.site-header {
    background: var(--navy);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.site-header .app-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.logo:hover {
    color: #fff;
    opacity: 0.9;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    font-size: 0.95rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.header-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.82);
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.header-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

.header-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

/* Main */
.app-main {
    flex: 1;
    padding: 32px 0 48px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.req {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
}

/* Cards */
.app-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--bg);
}

.app-card-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--navy);
    padding: 14px 18px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.app-alert {
    border-radius: var(--radius);
}

/* Stat cards */
.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 18px;
    text-align: center;
    height: 100%;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(49, 130, 206, 0.10);
    color: var(--blue);
    font-size: 1.1rem;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* Buttons */
.btn-navy {
    background: var(--navy);
    border: 1px solid var(--navy);
    color: #fff;
    font-weight: 500;
}

.btn-navy:hover,
.btn-navy:focus {
    background: var(--navy-light);
    border-color: var(--navy-light);
    color: #fff;
}

.btn-navy:disabled {
    background: var(--navy);
    border-color: var(--navy);
    opacity: 0.6;
    color: #fff;
}

.btn-outline-navy {
    border: 1px solid var(--navy);
    color: var(--navy);
    font-weight: 500;
    background: transparent;
}

.btn-outline-navy:hover,
.btn-outline-navy:focus {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

/* Tables */
.app-table thead th {
    background: var(--bg-alt);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    white-space: nowrap;
}

.app-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.app-table tbody tr:last-child td {
    border-bottom: 0;
}

.app-table tbody tr:hover {
    background: rgba(49, 130, 206, 0.04);
}

/* Empty state */
.empty-state {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2.4rem;
    color: var(--blue);
    opacity: 0.5;
    margin-bottom: 14px;
}

/* Auth */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 24px 0;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card .card-body {
    padding: 36px 32px;
}

/* Keyword chips */
.keyword-chip {
    display: inline-block;
    background: rgba(49, 130, 206, 0.10);
    color: var(--navy-light);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0 6px 6px 0;
}

/* Grade badges */
.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.grade-badge.grade-lg {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
}

.grade-A { background: var(--success); }
.grade-B { background: #68a63d; }
.grade-C { background: var(--warning); }
.grade-D { background: #dd7a1e; }
.grade-E { background: var(--danger); }

/* Score circle */
.score-circle {
    --score: 0;
    --score-color: var(--blue);
    width: 170px;
    height: 170px;
    border-radius: 50%;
    margin: 0 auto;
    background: conic-gradient(var(--score-color) calc(var(--score) * 1%), var(--border) 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-inner {
    width: 134px;
    height: 134px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.score-max {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.summary-text {
    white-space: pre-line;
}

/* Category bars */
.category-row + .category-row {
    margin-top: 18px;
}

.score-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* Platform cards */
.platform-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    height: 100%;
    background: var(--bg);
}

.platform-score {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Lists */
.check-list {
    list-style: none;
    padding-left: 0;
}

.check-list li + li {
    margin-top: 8px;
}

.recommendation-item {
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    padding: 12px 16px;
    background: var(--bg);
}

/* Analysis run */
.analysis-run-card {
    border-left: 4px solid var(--blue);
}

.analysis-progress {
    display: flex;
    align-items: center;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Input JSON */
.input-json {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    font-size: 0.78rem;
    max-height: 420px;
    overflow: auto;
}

/* Footer */
.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 18px 0;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 0.2rem rgba(49, 130, 206, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

/* Print */
@media print {
    .site-header,
    .site-footer,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .app-card {
        box-shadow: none;
        break-inside: avoid;
    }
}

@media (max-width: 767px) {
    .header-nav .nav-link span {
        display: none;
    }

    .header-nav .nav-link {
        padding: 8px 11px;
        font-size: 1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }
}

/* Danger zone */
.danger-zone {
    border-color: rgba(229, 62, 62, 0.4);
}

.danger-zone .app-card-header {
    border-bottom-color: rgba(229, 62, 62, 0.25);
}

/* Header action buttons */
.head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
