/* style.css */
/* Introduction Reviewer */

:root {
    --bg: #f5f0e8;
    --bg-2: #fff9f0;
    --ink: #172033;
    --muted: #687085;
    --primary: #17479d;
    --primary-2: #0d2f6b;
    --accent: #ee6823;
    --accent-2: #ffb36b;
    --card: rgba(255, 255, 255, 0.92);
    --line: rgba(23, 32, 51, 0.12);
    --shadow: 0 24px 70px rgba(23, 32, 51, 0.14);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(238, 104, 35, 0.22), transparent 34%),
        radial-gradient(circle at top right, rgba(23, 71, 157, 0.20), transparent 28%),
        linear-gradient(135deg, #fbf6ef 0%, #f1f5ff 52%, #fff4e8 100%);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: inherit;
}

.app-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    padding: 26px;
    color: white;
    background:
        linear-gradient(135deg, rgba(23, 71, 157, 0.96), rgba(13, 47, 107, 0.94)),
        url("https://channel.mediacdn.vn/428462621602512896/2023/8/8/huflitclean-16914696561351904203768.jpg");
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 25%),
        radial-gradient(circle at 90% 10%, rgba(238, 104, 35, 0.55), transparent 28%);
    pointer-events: none;
}

.topbar,
.hero-grid {
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 50px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    color: var(--primary);
    background: white;
    font-weight: 900;
    letter-spacing: -0.03em;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.92rem;
    opacity: 0.78;
}

.guide-link,
.ghost-button,
.secondary-button,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 750;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.guide-link {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(10px);
}

.guide-link:hover,
.ghost-button:hover,
.secondary-button:hover,
.primary-button:hover {
    transform: translateY(-1px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.75fr;
    gap: 24px;
    align-items: end;
}

.eyebrow,
.section-kicker {
    margin: 0 0 10px;
    color: var(--accent-2);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 900px;
    margin: 0;
    font-size: clamp(2.3rem, 5.4vw, 5.1rem);
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.hero-text {
    max-width: 760px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.7;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.hero-badges span,
.learning-items span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    font-weight: 750;
    font-size: 0.86rem;
}

.hero-badges span {
    color: white;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.profile-card {
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(14px);
}

.profile-label {
    color: var(--accent-2);
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.profile-name {
    margin-top: 10px;
    font-size: 1.35rem;
    font-weight: 850;
}

.profile-meta {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    word-break: break-word;
}

.profile-card p {
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 24px;
    margin-top: 24px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--card);
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
    backdrop-filter: blur(12px);
}

.input-panel,
.output-panel {
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.panel-header h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    letter-spacing: -0.035em;
}

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

.form-group {
    margin-bottom: 18px;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #25304a;
    font-weight: 800;
}

label span {
    color: var(--accent);
}

small,
.small-note {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(23, 32, 51, 0.14);
    border-radius: 16px;
    padding: 14px 15px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.82);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
    resize: vertical;
    min-height: 92px;
}

#draftIntroduction {
    min-height: 300px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(23, 71, 157, 0.55);
    box-shadow: 0 0 0 4px rgba(23, 71, 157, 0.12);
    background: white;
}

input:disabled,
textarea:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

.method-note {
    margin: 6px 0 20px;
    padding: 14px 16px;
    border-radius: 16px;
    color: #17479d;
    background: rgba(23, 71, 157, 0.07);
    border: 1px solid rgba(23, 71, 157, 0.14);
    line-height: 1.6;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.primary-button {
    min-width: 230px;
    color: white;
    background: linear-gradient(135deg, var(--accent), #ff8b45);
    box-shadow: 0 18px 35px rgba(238, 104, 35, 0.25);
}

.secondary-button {
    color: var(--primary);
    background: rgba(23, 71, 157, 0.08);
}

.ghost-button {
    color: var(--primary);
    background: white;
    border: 1px solid rgba(23, 71, 157, 0.14);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none !important;
}

.button-spinner,
.large-spinner {
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    animation: spin 0.85s linear infinite;
}

.button-spinner {
    display: none;
    width: 18px;
    height: 18px;
}

.primary-button.is-loading .button-spinner {
    display: inline-block;
}

.large-spinner {
    width: 54px;
    height: 54px;
    border-color: rgba(23, 71, 157, 0.16);
    border-top-color: var(--primary);
}

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

.output-actions {
    display: flex;
    gap: 10px;
}

.status-box {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    line-height: 1.55;
    border: 1px solid var(--line);
    background: rgba(23, 71, 157, 0.06);
    color: var(--primary-2);
}

.status-box.success {
    background: rgba(26, 137, 23, 0.08);
    color: #176014;
    border-color: rgba(26, 137, 23, 0.16);
}

.status-box.error {
    background: rgba(189, 42, 42, 0.08);
    color: #8d1f1f;
    border-color: rgba(189, 42, 42, 0.16);
}

.status-box.loading {
    background: rgba(238, 104, 35, 0.09);
    color: #9a4212;
    border-color: rgba(238, 104, 35, 0.18);
}

.result {
    min-height: 640px;
    max-height: 82vh;
    overflow: auto;
    padding: 24px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 248, 0.98));
    border: 1px solid rgba(23, 32, 51, 0.10);
}

.result h1 {
    margin: 0 0 22px;
    color: var(--primary-2);
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.result h2 {
    margin: 30px 0 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(23, 32, 51, 0.10);
    color: var(--primary);
    font-size: 1.35rem;
    letter-spacing: -0.025em;
}

.result h3 {
    margin: 18px 0 8px;
    color: #25304a;
}

.result p,
.result li,
.result td,
.result th {
    line-height: 1.72;
}

.result p {
    margin: 0 0 14px;
}

.result ul,
.result ol {
    margin: 10px 0 18px;
    padding-left: 24px;
}

.result table {
    width: 100%;
    margin: 16px 0 20px;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(23, 32, 51, 0.10);
}

.result th,
.result td {
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(23, 32, 51, 0.10);
}

.result th {
    color: white;
    background: var(--primary);
}

.result tr:nth-child(even) td {
    background: rgba(23, 71, 157, 0.04);
}

.empty-state,
.loading-state,
.error-state {
    display: grid;
    place-items: center;
    text-align: center;
}

.empty-state h3,
.loading-state h3,
.error-state h3 {
    margin-bottom: 8px;
}

.empty-state p,
.loading-state p,
.error-state p {
    max-width: 560px;
    color: var(--muted);
}

.empty-icon,
.error-icon {
    font-size: 3rem;
}

.loader-card,
.error-card {
    display: grid;
    justify-items: center;
    gap: 12px;
}

.learning-strip {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 18px;
    align-items: center;
    margin-top: 24px;
    padding: 24px;
    border-radius: var(--radius-xl);
    color: white;
    background: linear-gradient(135deg, #132a58, #17479d);
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.12);
}

.learning-strip h3 {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.learning-strip p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
}

.learning-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.learning-items span {
    color: white;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.footer {
    padding: 22px;
    color: var(--muted);
    text-align: center;
}

/* Guide page */

.guide-page {
    max-width: 1080px;
    margin: 0 auto;
}

.guide-hero {
    padding: 42px;
    border-radius: var(--radius-xl);
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: var(--shadow);
}

.guide-hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 4rem);
    letter-spacing: -0.055em;
}

.guide-hero p {
    max-width: 800px;
    color: rgba(255, 255, 255, 0.80);
    line-height: 1.7;
}

.guide-content {
    margin-top: 24px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--card);
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

.guide-content h2 {
    margin-top: 34px;
    color: var(--primary);
}

.guide-content h2:first-child {
    margin-top: 0;
}

.guide-content p,
.guide-content li {
    line-height: 1.75;
}

.example-box {
    margin: 18px 0;
    padding: 18px;
    border-radius: 18px;
    background: rgba(23, 71, 157, 0.06);
    border: 1px solid rgba(23, 71, 157, 0.12);
}

[hidden] {
    display: none !important;
}

/* Responsive */

@media (max-width: 1100px) {
    .main-grid,
    .hero-grid,
    .learning-strip {
        grid-template-columns: 1fr;
    }

    .learning-items {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .app-shell {
        padding: 12px;
    }

    .hero {
        padding: 18px;
        border-radius: 22px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 32px;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .profile-card {
        padding: 18px;
    }

    .main-grid {
        gap: 14px;
        margin-top: 14px;
    }

    .input-panel,
    .output-panel,
    .learning-strip,
    .guide-content,
    .guide-hero {
        padding: 18px;
        border-radius: 22px;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .two-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-actions,
    .output-actions {
        width: 100%;
        flex-direction: column;
    }

    .primary-button,
    .secondary-button,
    .ghost-button,
    .guide-link {
        width: 100%;
    }

    .result {
        min-height: 480px;
        max-height: none;
        padding: 16px;
    }

    .result table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
