/*
 * GC logs analyzer pages (the web pages and the report of the command line application) - loaded after the shared
 * /css/app.css, which gives the look, the colors and the dark theme. Only the components that the other tools do not
 * use are defined here; every color comes from a variable with a dark variant, so the pages follow the theme switch.
 */

:root {
    --alert-warning-bg: #fffbeb;
    --alert-warning-border: #fcd34d;
    --alert-warning-text: #92400e;
    --alert-success-bg: #f0fdf4;
    --alert-success-border: #86efac;
    --alert-success-text: #166534;
    --alert-danger-bg: #fef2f2;
    --alert-danger-border: #fca5a5;
    --alert-danger-text: #991b1b;
    --mark-bg: #fef3cd;
    --mark-text: inherit;
    --link-green: #059669;
    --link-red: #dc2626;
    --icon-upload-bg: #eef2ff;
    --icon-upload-fg: #4f46e5;
    --icon-docker-bg: #eff6ff;
    --icon-docker-fg: #2563eb;
    --icon-github-bg: #f0fdf4;
    --icon-github-fg: #059669;
    --icon-blog-bg: #fef3c7;
    --icon-blog-fg: #d97706;
}

:root.dark {
    --alert-warning-bg: #422006;
    --alert-warning-border: #a16207;
    --alert-warning-text: #fde68a;
    --alert-success-bg: #052e16;
    --alert-success-border: #15803d;
    --alert-success-text: #bbf7d0;
    --alert-danger-bg: #450a0a;
    --alert-danger-border: #b91c1c;
    --alert-danger-text: #fecaca;
    --mark-bg: #713f12;
    --mark-text: #fef3c7;
    --link-green: #34d399;
    --link-red: #f87171;
    --icon-upload-bg: #1e1b4b;
    --icon-upload-fg: #a5b4fc;
    --icon-docker-bg: #172554;
    --icon-docker-fg: #93c5fd;
    --icon-github-bg: #052e16;
    --icon-github-fg: #6ee7b7;
    --icon-blog-bg: #451a03;
    --icon-blog-fg: #fcd34d;
}

/* ---- Typography ---- */
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.25rem; }
p { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}
.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
    color: var(--text);
}
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 600; }
.mb-3 { margin-bottom: 1.5rem; }
.w-auto { width: auto; }

/* ---- Buttons ---- */
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ---- Forms ---- */
select.form-input {
    cursor: pointer;
    appearance: auto;
}
textarea.form-input {
    resize: vertical;
    min-height: 120px;
    font-family: var(--mono);
    font-size: 0.8125rem;
    line-height: 1.5;
}
input[type="file"].form-input {
    padding: 0.375rem 0.75rem;
}
.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ---- Landing page (gclogs-com-site profile) ---- */
.feature-card .icon-upload { background: var(--icon-upload-bg); color: var(--icon-upload-fg); }
.feature-card .icon-docker { background: var(--icon-docker-bg); color: var(--icon-docker-fg); }
.feature-card .icon-github { background: var(--icon-github-bg); color: var(--icon-github-fg); }
.feature-card .icon-blog { background: var(--icon-blog-bg); color: var(--icon-blog-fg); }

/* ---- Alerts ---- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}
.alert a { text-decoration: underline; }
.alert h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}
.alert-warning {
    background: var(--alert-warning-bg);
    border: 1px solid var(--alert-warning-border);
    color: var(--alert-warning-text);
}
.alert-warning a { color: var(--alert-warning-text); }
.alert-success {
    background: var(--alert-success-bg);
    border: 1px solid var(--alert-success-border);
    color: var(--alert-success-text);
}
.alert-success a { color: var(--alert-success-text); }
.alert-danger {
    background: var(--alert-danger-bg);
    border: 1px solid var(--alert-danger-border);
    color: var(--alert-danger-text);
}
.alert-danger a { color: var(--alert-danger-text); }

/* ---- Progress bar ---- */
.progress {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.75rem;
}
.progress-bar {
    height: 100%;
    background: var(--bg-accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ---- Code blocks ---- */
pre {
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    overflow-x: auto;
}
pre code {
    display: block;
    padding: 1rem 1.25rem;
    background: var(--bg-sidebar);
    color: var(--text-sidebar-active);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 0.8125rem;
    line-height: 1.6;
}
code {
    font-family: var(--mono);
    font-size: 0.875em;
}
kbd {
    background: var(--bg-sidebar);
    color: var(--text-sidebar-active);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.8125em;
    white-space: nowrap;
}
mark {
    background: var(--mark-bg);
    color: var(--mark-text);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* ---- Definition list ---- */
dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}
dt { font-weight: 500; }
dd { margin: 0; color: var(--text-secondary); }

/* ---- Collapse ---- */
.collapse { display: none; }
.collapse.show { display: block; }

/* ---- Waiting for results ---- */
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--bg-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.centered-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}
.centered-page .card {
    max-width: 560px;
    width: 100%;
}

/* ---- Results: sidebar with the report pages ---- */
.viewer-sidebar .sidebar-brand a:hover {
    color: var(--text-sidebar-active);
    text-decoration: none;
}
.viewer-sidebar .nav-list {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}
.viewer-sidebar .nav-item {
    list-style: none;
    margin: 0;
}
.viewer-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    color: var(--text-sidebar);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.viewer-sidebar .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-sidebar-active);
    text-decoration: none;
    border-left-color: rgba(255,255,255,0.2);
}
.viewer-sidebar .nav-link.active {
    color: var(--text-sidebar-active);
    background: rgba(255,255,255,0.08);
    border-left-color: var(--bg-accent);
}
.viewer-sidebar .nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}
.viewer-sidebar .nav-link:hover svg,
.viewer-sidebar .nav-link.active svg {
    opacity: 1;
}

/* The report scrolls as a whole page - the JFR viewer shows its content in an iframe instead */
.viewer-content {
    padding: 2rem;
    display: block;
    overflow-x: hidden;
}

/* ---- Results: report pages ---- */
.subpage h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}
.subpage h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.subpage > span {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.img-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}
.highcharts-figure {
    margin: 0;
}

table.data-table td { white-space: nowrap; }
table.data-table thead.sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
}
.table-with-link-green { color: var(--link-green); font-weight: 600; }
.table-with-link-red { color: var(--link-red); font-weight: 600; }

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.875rem;
    background: var(--bg-input);
    color: var(--text);
    outline: none;
    margin-bottom: 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
