/**
 * Expert profile — Luma.com–inspired layout: airy spacing, soft elevation,
 * editorial typography, pill actions. See https://luma.com/
 *
 * Card-style blocks: no border, elevation via box-shadow (--expert-block-shadow).
 */

/* -------------------------------------------------------------------------
   Page shell
   ------------------------------------------------------------------------- */
.luma-expert-profile {
    --expert-block-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --expert-block-shadow-strong: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
    --expert-inline-shadow: 0 1px 4px rgba(0, 0, 0, 0.07), 0 0 1px rgba(0, 0, 0, 0.04);
}

[data-bs-theme="dark"] .luma-expert-profile {
    --expert-block-shadow: 0 4px 28px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);
    --expert-block-shadow-strong: 0 8px 36px rgba(0, 0, 0, 0.6), 0 2px 12px rgba(0, 0, 0, 0.4);
    --expert-inline-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 0, 0, 0.3);
}

.luma-expert-profile.expert-detail-page {
    background: var(--bg-secondary);
    min-height: 100vh;
    padding: 1.5rem 0 3rem;
}

.luma-expert-profile__container {
    max-width: 920px;
}

.luma-expert-profile__back {
    margin-bottom: 1.25rem;
}

/* Same corner radius as Events index “Create Hackathon”; border from global .btn-back */
.luma-expert-profile .luma-expert-profile__back .btn-back {
    border-radius: var(--events-search-control-radius, 12px) !important;
}

.expert-detail-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* -------------------------------------------------------------------------
   Hero header
   ------------------------------------------------------------------------- */
.luma-expert-hero.expert-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    background: var(--card-bg);
    border-radius: 1rem;
    border: none;
    box-shadow: var(--expert-block-shadow);
}

.luma-expert-hero__main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
    flex: 1;
}

.expert-detail-avatar {
    width: 88px;
    height: 88px;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    box-shadow: var(--expert-inline-shadow);
}

.expert-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.expert-detail-title {
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.15;
}

.expert-detail-fullname {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0.35rem 0 0 0;
    line-height: 1.4;
    font-weight: 400;
}

.expert-detail-role {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin: 0.4rem 0 0 0;
    letter-spacing: 0.02em;
}

.expert-detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
    padding-top: 0.15rem;
}

/* Luma-style buttons — match Events index Create Hackathon control radius */
.luma-expert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: var(--events-search-control-radius, 12px);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.luma-expert-btn svg {
    flex-shrink: 0;
}

.luma-expert-btn--primary {
    background: var(--text-primary);
    color: var(--card-bg);
    border-color: var(--text-primary);
}

.luma-expert-btn--primary:hover {
    opacity: 0.92;
    color: var(--card-bg);
}

[data-bs-theme="dark"] .luma-expert-btn--primary {
    background: #f8f9fa;
    color: #111;
    border-color: #f8f9fa;
}

[data-bs-theme="dark"] .luma-expert-btn--primary:hover {
    opacity: 0.9;
    color: #111;
}

.luma-expert-btn--ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.luma-expert-btn--ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .luma-expert-btn--ghost {
    border-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .luma-expert-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* -------------------------------------------------------------------------
   Grid
   ------------------------------------------------------------------------- */
.expert-detail-grid {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 300px);
    gap: 1.5rem;
    align-items: start;
}

/* -------------------------------------------------------------------------
   Main card
   ------------------------------------------------------------------------- */
.luma-expert-profile__main-card.luma-expert-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.75rem 1.75rem 1.5rem;
    border: none;
    box-shadow: var(--expert-block-shadow);
}

.expert-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: none;
    box-shadow: var(--hairline-divider);
}

.expert-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    box-shadow: none;
}

.expert-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
    text-transform: none;
}

.expert-section-content {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.65;
    font-weight: 400;
}

.expert-section-content p {
    margin: 0;
    white-space: pre-line;
}

/* Social (Links) — same radius as Create Hackathon / events controls */
.expert-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expert-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--events-search-control-radius, 12px);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.expert-social-link:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
    transform: none;
}

[data-bs-theme="dark"] .expert-social-link {
    border-color: rgba(255, 255, 255, 0.12);
    background: transparent;
}

[data-bs-theme="dark"] .expert-social-link:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.expert-social-link svg {
    flex-shrink: 0;
    opacity: 0.85;
}

/* -------------------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------------------- */
.expert-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expert-sidebar-card.luma-sidebar-card {
    padding: 1.25rem 1.35rem;
    border-radius: 1rem;
    border: none !important;
    box-shadow: var(--expert-block-shadow);
}

[data-bs-theme="dark"] .expert-sidebar-card.luma-sidebar-card {
    border: none !important;
}

.expert-sidebar-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
    letter-spacing: -0.01em;
}

.expert-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Meta rows — label / value row like Luma settings */
.luma-expert-meta.expert-sidebar-content {
    gap: 0;
}

.luma-expert-meta .expert-info-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: none;
    box-shadow: var(--hairline-divider);
}

.luma-expert-meta .expert-info-row:last-child {
    box-shadow: none;
    padding-bottom: 0;
}

.luma-expert-meta .expert-info-row:first-child {
    padding-top: 0;
}

.expert-info-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.expert-info-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* Events list */
.expert-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.expert-events-list li {
    border-radius: var(--events-search-control-radius, 12px);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: transparent;
    box-shadow: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.expert-events-list li:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-bs-theme="dark"] .expert-events-list li {
    border-color: rgba(255, 255, 255, 0.1);
    background: transparent;
}

[data-bs-theme="dark"] .expert-events-list li:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.expert-events-list li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.65rem 0.85rem;
    display: block;
    width: 100%;
}

.expert-events-list li a:hover {
    color: var(--text-primary);
    background: transparent;
}

/* Legacy / unused in template but kept for safety */
.expert-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
}

.section-icon {
    color: var(--bs-primary);
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .expert-detail-grid {
        grid-template-columns: 1fr;
    }

    .expert-detail-sidebar {
        order: 1;
    }
}

@media (max-width: 768px) {
    .luma-expert-profile.expert-detail-page {
        padding: 1rem 0 2rem;
    }

    .luma-expert-hero.expert-detail-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem 1.15rem;
    }

    .luma-expert-hero__main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .expert-detail-avatar {
        width: 80px;
        height: 80px;
    }

    .expert-detail-actions {
        margin-left: 0;
        width: 100%;
        justify-content: stretch;
        padding-top: 0;
    }

    .luma-expert-btn--primary {
        width: 100%;
    }

    .luma-expert-profile__main-card.luma-expert-card {
        padding: 1.35rem 1.15rem;
    }

    .expert-social-links {
        flex-direction: column;
    }

    .expert-social-link {
        justify-content: center;
    }
}

/* manage_moderators.css sets .manage-experts-page { margin-top: 3rem }; expert dashboard should sit flush */
.expert-dashboard-page.manage-experts-page {
    margin-top: 0;
}

/* Page chrome: back + “Expert Dashboard” (stacked on small screens, one row from md) */
.expert-dashboard-page .expert-dashboard-page-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .expert-dashboard-page .expert-dashboard-page-heading {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
}

/* Override custom.css global h1 { font-size: 36px !important } */
.expert-dashboard-page .expert-dashboard-page-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
    line-height: 1.25 !important;
}

@media (min-width: 768px) {
    .expert-dashboard-page .expert-dashboard-page-title {
        font-size: 1.375rem !important;
        text-align: right;
    }
}

.luma-expert-profile .expert-dashboard-page-heading__back .btn-back {
    border-radius: var(--events-search-control-radius, 12px) !important;
}

/* Expert dashboard — compact event hero (desktop + mobile Expert badge: top-right of header) */
.expert-dashboard-event-hero.luma-expert-hero.expert-detail-header {
    padding: 1rem 1.15rem;
    gap: 0;
}

.expert-dashboard-event-hero .expert-dashboard-hero__left {
    gap: 0.35rem;
}

.expert-dashboard-event-hero .expert-dashboard-hero__inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Smaller cover than default event-detail hero (detail.css 132px) */
.expert-dashboard-event-hero.event-detail-hero .event-detail-avatar {
    width: 72px;
    height: 72px;
    border-radius: 0.75rem;
}

.expert-dashboard-event-hero .expert-detail-title {
    font-size: clamp(1.0625rem, 2.35vw, 1.3rem) !important;
    font-weight: 700 !important;
    line-height: 1.25;
}

/* Desktop: description under title in the same column as before (respects badge padding on .expert-detail-info) */
.expert-dashboard-event-hero .expert-dashboard-hero__description--desktop {
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* Mobile: full width below avatar+title row (unchanged) */
.expert-dashboard-event-hero .expert-dashboard-hero__description--mobile {
    font-size: 0.8125rem;
    line-height: 1.45;
    max-width: none;
    width: 100%;
    margin-top: 0;
    padding-right: 0;
    align-self: stretch;
}

@media (min-width: 768px) {
    .expert-dashboard-event-hero .expert-detail-title {
        font-size: clamp(1.125rem, 2.65vw, 1.45rem) !important;
    }

    /* Tighter than 5.5rem so title + description use more line length; badge still clears */
    .expert-dashboard-event-hero .expert-detail-info {
        padding-right: 4rem;
    }

    /* Top-right of hero card; override cards.css .luma-event-card-badge (bottom/right for overlays) */
    .expert-dashboard-event-hero .expert-dashboard-hero__expert-badge--desktop {
        position: absolute !important;
        top: 1rem;
        right: 1.15rem;
        bottom: auto !important;
        left: auto;
        z-index: 2;
    }
}

.expert-dashboard-event-hero .expert-dashboard-hero__meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.expert-dashboard-event-hero .expert-dashboard-hero__meta-start {
    flex: 1 1 auto;
    min-width: 0;
}

.expert-dashboard-event-hero .expert-dashboard-hero__meta-start .event-detail-hero__meta {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .expert-dashboard-event-hero.luma-expert-hero.expert-detail-header {
        padding: 1rem 1.15rem;
    }

    /* Top-right of hero card (same inset as desktop) */
    .expert-dashboard-event-hero .expert-dashboard-hero__expert-badge--mobile {
        position: absolute !important;
        top: 1rem;
        right: 1.15rem;
        bottom: auto !important;
        left: auto;
        z-index: 2;
    }

    .expert-dashboard-event-hero .expert-detail-info {
        padding-right: 3.75rem;
    }

    /* Keep avatar + title row (global hero mobile centers this block) */
    .expert-dashboard-event-hero .luma-expert-hero__main {
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
    }

    .expert-dashboard-event-hero.event-detail-hero .event-detail-avatar {
        width: 64px;
        height: 64px;
    }
}

/* Expert event dashboard — team cards in 3 columns (teams index uses 4) */
.expert-dashboard-page .expert-dashboard-teams-grid .luma-team-list-card-name {
    font-size: 1rem;
}

.expert-dashboard-page .expert-dashboard-teams-grid .luma-team-list-card-icon {
    width: 48px;
    height: 48px;
}

.expert-dashboard-page .expert-dashboard-teams-grid .luma-team-list-card-icon svg {
    width: 24px;
    height: 24px;
}
