/* Styles for public-facing profile pages (/profiles and /profiles/*) */
/* Intentionally standalone — no session or auth assumptions */

/* ── Public nav ────────────────────────────────────────────────────────────── */

.public-nav {
    background-color: #f8f9fa;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.public-nav-logo a {
    display: inline-flex;
    align-items: center;
}

.public-nav-logo img {
    height: 30px;
    width: auto;
}

.public-nav-links {
    display: flex;
    gap: 5px;
    justify-self: center;
}

.public-nav-links a {
    color: #333;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-family: 'Avenir', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
}

.public-nav-links a:hover {
    background-color: #e9ecef;
}

.public-nav-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.public-nav-login-btn {
    color: #3498db;
    text-decoration: none;
    font-size: 0.85em;
    padding: 5px 14px;
    border: 1px solid #3498db;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: 'Avenir', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    white-space: nowrap;
}

.public-nav-login-btn:hover {
    background-color: #3498db;
    color: #fff;
}

@media (max-width: 600px) {
    .public-nav {
        grid-template-columns: auto 1fr auto;
        padding: 10px 15px;
        gap: 8px;
    }

    .public-nav-logo img {
        height: 24px;
    }

    .public-nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0;
        max-width: 100%;
    }

    .public-nav-links a {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* ── Page layout ────────────────────────────────────────────────────────────── */

.profiles-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Avenir', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.profiles-header {
    margin-bottom: 32px;
}

.profiles-header h1 {
    color: #2c3e50;
    font-size: 2em;
    margin: 0 0 8px;
}

.profiles-subtitle {
    color: #7f8c8d;
    font-size: 1em;
    margin: 0;
}

.profiles-about-section .profile-prose {
    max-width: 42em;
}

/* ── Profile index filters (operators / networks lists) ───────────────────── */

.profiles-index-toolbar {
    margin-bottom: 20px;
}

.profiles-index-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 20px;
}

.profiles-index-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.profiles-index-field-search {
    flex: 0 1 260px;
    max-width: 260px;
    width: 100%;
}

.profiles-index-label {
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7680;
}

.profiles-index-input,
.profiles-index-select {
    box-sizing: border-box;
    height: 38px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #c5cdd4;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    background-color: #fff;
    color: #2c3e50;
    min-width: 0;
    line-height: normal;
}

.profiles-index-input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Native selects use different box metrics; reset so height matches search input */
.profiles-index-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7680' d='M1.41 0 6 4.59 10.59 0 12 1.41l-6 6-6-6L1.41 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
}

.profiles-index-input:focus,
.profiles-index-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.profiles-index-field:not(.profiles-index-field-search) .profiles-index-select {
    min-width: 200px;
}

.profiles-index-active-wrap {
    flex: 0 1 auto;
}

.profiles-index-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 38px;
    cursor: pointer;
    font-size: 0.92em;
    color: #2c3e50;
    user-select: none;
    margin: 0;
    white-space: nowrap;
}

.profiles-index-active-filter input {
    margin: 0;
    cursor: pointer;
}

.profiles-index-count {
    margin: 0 0 14px;
    font-size: 0.88em;
    color: #6b7680;
}

.profiles-index-no-matches {
    color: #7f8c8d;
    padding: 24px 0;
    text-align: center;
}

.profiles-index-no-matches p {
    margin: 0;
}

@media (max-width: 640px) {
    .profiles-index-field-search {
        flex: 1 1 100%;
        max-width: none;
    }

    .profiles-index-field:not(.profiles-index-field-search) .profiles-index-select {
        min-width: 100%;
    }

    .profiles-index-active-wrap {
        width: 100%;
    }
}

/* ── Profile hub / index grid (reusable across profile types) ─────────────── */

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.profile-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid #e8ecef;
}

.profile-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.profile-card-name {
    font-size: 1.05em;
    font-weight: bold;
    color: #2c3e50;
}

.profile-card-meta {
    font-size: 0.85em;
    color: #7f8c8d;
}

.profile-card-tech {
    font-size: 0.8em;
    color: #34495e;
    background-color: #f0f4f8;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
}

.profile-card-link {
    font-size: 0.82em;
    color: #3498db;
    margin-top: auto;
    padding-top: 10px;
}

.profiles-empty {
    color: #7f8c8d;
    padding: 40px 0;
    text-align: center;
}

/* ── Individual profile ─────────────────────────────────────────────────────── */

.profile-breadcrumb {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.profile-breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: #bdc3c7;
}

.profile-hero {
    margin-bottom: 32px;
}

.profile-hero-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 8px;
}

.profile-hero-title-row h1 {
    flex: 1 1 200px;
    min-width: 0;
}

.profile-hero-main {
    min-width: 0;
}

/* Record facts (country, validity) — compact block directly under the title */
.profile-hero-main > h1 + .profile-hero-record-line,
.profile-hero-main > .profile-hero-title-row + .profile-hero-record-line {
    margin-top: 2px;
}

.profile-hero-main .profile-country.profile-hero-record-line {
    margin-bottom: 0;
}

.profile-hero-main .profile-country + .profile-validity.profile-hero-record-line {
    margin-top: 6px;
}

/* Ontology kind line — below h1 (and below country/validity on org/network); separated by rule */
.profile-hero-main > p.profile-hero-kind {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid #e8ecef;
    font-size: 0.88em;
    line-height: 1.45;
    color: #6b7680;
    text-align: left;
    white-space: pre-line;
}

.profile-hero-main > p.profile-hero-kind strong {
    color: #5d6d7e;
    font-weight: 600;
}

.profile-hero-chips {
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

@media (min-width: 600px) {
    .profile-hero-title-row .profile-hero-chips {
        max-width: min(420px, 48%);
    }
}

/* Type chips in hero — hover / focus shows sources & dates */
.profile-chip-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.profile-chip {
    display: inline-block;
    max-width: 200px;
    padding: 6px 14px;
    border-radius: 999px;
    background-color: #e8f4fc;
    color: #2c3e50;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: default;
    border: 1px solid #b8d4e8;
    transition: background-color 0.15s, border-color 0.15s;
}

a.profile-chip--link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

a.profile-chip--link:hover,
a.profile-chip--link:focus {
    color: inherit;
    outline: none;
}

.profile-chip-wrap:focus-within a.profile-chip--link:focus {
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.45);
}

.profile-chip-wrap:hover .profile-chip,
.profile-chip-wrap:focus-within .profile-chip {
    background-color: #d4e9f7;
    border-color: #3498db;
}

.profile-chip-tooltip {
    display: none;
    position: absolute;
    z-index: 100;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    max-width: min(360px, 90vw);
    padding: 10px 12px;
    background-color: #fff;
    border: 1px solid #dce4ec;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    text-align: left;
    font-size: 0.82em;
    font-weight: normal;
    color: #34495e;
}

/* Invisible hover bridge so pointer can reach tooltip */
.profile-chip-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 8px;
}

.profile-chip-wrap:hover .profile-chip-tooltip,
.profile-chip-wrap:focus-within .profile-chip-tooltip {
    display: block;
}

.profile-chip-tooltip-dates {
    font-size: 0.92em;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.profile-chip-tooltip-body {
    border-top: 1px solid #ecf0f1;
    padding-top: 8px;
    margin-top: 0;
}

.profile-chip-tooltip-dates:first-child:last-child {
    margin-bottom: 0;
}

.profile-chip-tooltip .profile-chip-tooltip-body:first-child {
    border-top: none;
    padding-top: 0;
}

.profile-hero h1 {
    color: #2c3e50;
    font-size: 2em;
    margin: 0 0 8px;
}

.profile-hero .profile-hero-title-row h1 {
    margin-bottom: 0;
}

.profile-country {
    color: #7f8c8d;
    font-size: 1em;
}

.profile-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecef;
    margin-bottom: 20px;
}

.profile-section h2 {
    color: #2c3e50;
    font-size: 1.15em;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.profile-section p {
    color: #34495e;
    line-height: 1.7;
    margin: 0;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.profile-table th,
.profile-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: top;
}

.profile-table th {
    color: #7f8c8d;
    font-weight: 600;
    width: 180px;
    white-space: nowrap;
    background-color: transparent;
    text-transform: none;
    font-size: 0.9em;
    letter-spacing: 0;
}

.profile-table td {
    color: #2c3e50;
}

.profile-table tr:last-child th,
.profile-table tr:last-child td {
    border-bottom: none;
}

.profile-back {
    margin-top: 10px;
    margin-bottom: 40px;
}

.profile-back a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
}

.profile-back a:hover {
    text-decoration: underline;
}

.profile-meta-line {
    font-size: 0.88em;
    color: #7f8c8d;
    margin-top: 8px;
}

.profile-section-prose .profile-prose,
.profile-comment.profile-prose {
    color: #34495e;
    line-height: 1.65;
    font-size: 0.95em;
}

.profile-prose a {
    color: #3498db;
}

.profile-prose p {
    margin: 0 0 0.75em;
}

.profile-prose p:last-child {
    margin-bottom: 0;
}

.profile-subheading {
    font-size: 0.95em;
    color: #34495e;
    margin: 18px 0 8px;
    font-weight: 600;
}

.profile-section > .profile-subheading:first-of-type {
    margin-top: 0;
}

.profile-predicate-list {
    list-style: none;
    margin: 0;
    padding: 0;
    color: #2c3e50;
    line-height: 1.5;
}

/* Dividers between rows — lighter than the h2 rule (1px solid #ecf0f1) */
.profile-predicate-list li {
    margin: 0;
    padding: 12px 0;
}

.profile-predicate-list li:not(:last-child) {
    border-bottom: 1px solid rgba(44, 62, 80, 0.06);
}

/* Links to other profile pages (entity-link partial in predicate lists, etc.) */
a.profile-cross-link {
    color: #c45327;
    text-decoration: none;
    font-weight: 600;
}

a.profile-cross-link:hover,
a.profile-cross-link:focus {
    color: #c45327;
    text-decoration: underline;
}

.profile-dates {
    color: #7f8c8d;
    font-size: 0.9em;
}

.profile-comment {
    margin-top: 6px;
    margin-left: 0;
    padding-left: 0;
    list-style: none;
}

.profile-rel-direction {
    color: #7f8c8d;
    margin-right: 4px;
}

.profile-rel-type {
    text-transform: lowercase;
    font-weight: 600;
    color: #34495e;
}

.profile-flags {
    color: #7f8c8d;
    font-size: 0.85em;
    margin-left: 4px;
}

.profile-entity-unknown {
    color: #2c3e50;
}

/* Slim “premium data” teasers (operator & network profiles only) */
.profile-premium-teasers-wrap {
    margin-top: 22px;
    margin-bottom: 8px;
}

.profile-premium-teasers-heading {
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b99a8;
    margin: 0 0 12px;
    padding-bottom: 0;
    border-bottom: none;
}

.profile-section-premium {
    padding: 10px 14px;
    margin-bottom: 10px;
}

.profile-section-premium-title {
    font-size: 0.92em;
    font-weight: 600;
    margin: 0 0 6px;
    padding-bottom: 0;
    border-bottom: none;
    color: #5d6d7e;
}

.profile-premium-chart-wrap {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    min-height: 34px;
}

.profile-premium-faux {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 34px;
    padding: 5px 10px 4px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #eef1f4 0%, #e2e8ec 100%);
}

.profile-premium-faux-bar {
    flex: 1;
    max-width: 14px;
    min-width: 6px;
    background: linear-gradient(180deg, #bdc3c7 0%, #95a5a6 100%);
    border-radius: 2px 2px 0 0;
    filter: blur(2.5px);
    opacity: 0.75;
}

.profile-premium-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px 10px;
    background: rgba(252, 253, 254, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.profile-premium-overlay p {
    margin: 0;
    font-size: 0.76em;
    line-height: 1.35;
    color: #3d5266;
    font-weight: 500;
}

.profile-premium-overlay a {
    color: #c45327;
    font-weight: 600;
    text-decoration: none;
}

.profile-premium-overlay a:hover,
.profile-premium-overlay a:focus {
    text-decoration: underline;
}

.profile-card-dates {
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 4px;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.public-footer {
    border-top: 1px solid #e8ecef;
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.8em;
    font-family: 'Avenir', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin-top: 20px;
}

.public-footer-data-note {
    margin: 16px 0 0;
    color: #95a5a6;
    font-size: 1em;
    line-height: 1.45;
}

.public-footer-links {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin: 14px auto 0;
    max-width: 520px;
    padding: 0 8px;
}

.public-footer-links a {
    color: #95a5a6;
    text-decoration: none;
    flex: 1 1 0;
    text-align: center;
    min-width: 5.5em;
}

.public-footer-links a:hover,
.public-footer-links a:focus {
    color: #7f8c8d;
    text-decoration: underline;
}

/* ── Profile G6 graphs (profile-graph.js) ─────────────────────────────────── */

.profile-graph-section .profile-graph-hint {
    margin: 0 0 12px;
    font-size: 0.88em;
    line-height: 1.45;
    color: #6b7680;
}

.profile-graph-container {
    min-height: 300px;
    border: 1px solid #e8ecef;
    border-radius: 8px;
    background: #fafbfc;
}

.profile-graph-empty {
    margin: 0;
    padding: 28px 16px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.95em;
}

.profile-graph-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 12px;
    font-size: 0.88em;
}

.profile-graph-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #2c3e50;
    user-select: none;
}

.profile-graph-filter input {
    margin: 0;
    cursor: pointer;
}

.profile-graph-toolbar-gap {
    width: 1px;
    height: 1.1em;
    background: #dce1e6;
    margin: 0 2px;
}

.profile-graph-toolbar-label {
    color: #6b7680;
    margin-right: -4px;
}

.profile-graph-btn {
    padding: 4px 10px;
    border: 1px solid #c5cdd4;
    border-radius: 6px;
    background: #fff;
    color: #2c3e50;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.35;
}

.profile-graph-btn:hover,
.profile-graph-btn:focus-visible {
    border-color: #3498db;
    color: #2980b9;
    outline: none;
}

.profile-graph-btn-active {
    border-color: #3498db;
    background: #e8f4fc;
    color: #21618c;
}

.profile-graph-btn-ghost {
    border-color: transparent;
    background: transparent;
    color: #5d6d7e;
}

.profile-graph-btn-ghost:hover,
.profile-graph-btn-ghost:focus-visible {
    background: #eef1f4;
    border-color: #dce1e6;
    color: #2c3e50;
}

@media (max-width: 520px) {
    .profile-graph-toolbar-gap {
        display: none;
    }
}
