/* Application stylesheet. Propshaft serves each file as it is; nothing is bundled.
   The fonts are not imported here: each layout links its own vendor/fonts*.css. */

:root {
    --sidebar-bg: #111111;
    --sidebar-collapsed-width: 80px;
    --sidebar-expanded-width: 260px;
    --orange-primary: #FF6C08;
    --orange-gradient: linear-gradient(90deg, #FF6C08 0%, #FF8A3A 100%);
    --bg-gray: var(--tpt-page, #E5E5E5);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body, input, button, select, textarea, p, h1, h2, h3, h4, h5, h6, span, a, div, td, th {
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.fa, .fas, .far, .fal, .fad, .fab,
[class^="fa-"], [class*=" fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--tpt-page, #E5E5E5);
    color: var(--tpt-text, #101828);
    display: flex;
}

/* --- SIDEBAR BASE --- */

.sidebar {
    width: var(--sidebar-collapsed-width);
    background-color: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    /* Above every drawer and dialog a page opens (the highest, the confirm
       dialog, is 20000): the sidebar is the way to every other page, so
       nothing covers it. */
    z-index: 30000;
    display: flex;
    flex-direction: column;
}

.sidebar:hover,
.sidebar.hold-open {
    width: var(--sidebar-expanded-width) !important;
}

/* --- SIDEBAR HEADER & LOGO --- */

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    padding: 0;
}

.logo-container {
    width: var(--sidebar-collapsed-width);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 !important;
}

.logo-container svg {
    width: 105px !important;
    height: auto !important;
    margin-right: -70px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.logo-container .logo-text-svg,
.logo-container svg path.logo-text-svg,
.logo-container svg g.logo-text-svg {
    opacity: 0 !important;
    transition: opacity 0.2s ease;
}

/* --- EXPANDED SIDEBAR HEADER STATE --- */

.sidebar:hover .sidebar-header,
.sidebar.hold-open .sidebar-header {
    justify-content: flex-start;
}

.sidebar:hover .logo-container,
.sidebar.hold-open .logo-container {
    width: var(--sidebar-expanded-width) !important;
    padding-left: 17px !important;
    justify-content: flex-start !important;
}

.sidebar:hover .logo-container svg,
.sidebar.hold-open .logo-container svg {
    width: 130px !important;
    margin-right: 0 !important;
}

.sidebar:hover .logo-container .logo-text-svg,
.sidebar.hold-open .logo-container .logo-text-svg,
.sidebar:hover .logo-container svg path.logo-text-svg,
.sidebar.hold-open .logo-container svg path.logo-text-svg {
    opacity: 1 !important;
}

/* --- NAVIGATION MENU --- */

.nav-menu {
    flex: 1;
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 48px;
    padding: 0 12px !important;
    color: #FFFFFF;
    text-decoration: none;
    white-space: nowrap;
    margin: 10px 12px !important;
    border-radius: 8px;
    position: relative;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.nav-item i {
    font-size: 22px;
    width: 32px !important;
    min-width: 32px !important;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar:hover .nav-item,
.sidebar.hold-open .nav-item {
    padding: 0 12px !important;
}

.nav-text {
    margin-left: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar:hover .nav-text,
.sidebar.hold-open .nav-text {
    opacity: 1 !important;
}

.nav-item.active {
    background: var(--orange-gradient);
    box-shadow: 0 4px 10px rgba(255, 108, 8, 0.3);
}

.nav-item:hover:not(.active) {
    background-color: rgba(255,255,255,0.05);
}

.sidebar,
.nav-item,
.nav-text,
.logo-text,
.sidebar-header {
    font-family: 'Mulish', sans-serif;
    font-weight: bold;
}

/* --- MAIN CONTENT & TOP BAR --- */

.main-content {
    margin-left: var(--sidebar-collapsed-width);
    flex: 1;
    padding: 10px 20px 20px 20px;
    transition: margin-left 0.3s;
    background-color: var(--tpt-page, #E5E5E5);
    min-height: 100vh;
}

.top-bar {
    background: var(--tpt-surface, #FFFFFF);
    border: 1px solid var(--tpt-border, #EAECF0);
    border-radius: 12px;
    padding: 10px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: var(--tpt-shadow-sm, 0 1px 2px rgba(16,24,40,0.05));
    position: relative;
}

.profile-menu,
.dropdown-content {
    font-family: 'Mulish', sans-serif;
}

.profile-menu {
    position: relative;
    color: var(--tpt-text-muted, #6B6862);
    display: inline-block;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.profile-summary::-webkit-details-marker {
    display: none;
}

.profile-menu[open] .dropdown-content {
    display: block;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--tpt-neutral-line, #CCCCCC);
    border-radius: 50%;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0 !important;
    top: calc(100% + 12px);
    background: var(--tpt-surface, #FFFFFF);
    min-width: 180px;
    box-shadow: var(--tpt-shadow-lg, 0 10px 25px rgba(0,0,0,0.08));
    border-radius: 10px;
    padding: 6px;
    z-index: 100;
    border: 1px solid var(--tpt-border, #EAEAEA);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    color: var(--tpt-text, #222222);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.dropdown-item i {
    font-size: 1rem;
    color: var(--tpt-text-subtle, #444444);
    width: 18px;
    text-align: center;
    transition: color 0.15s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 108, 8, 0.1);
    color: var(--orange-primary, #FF6C08);
}

.dropdown-item:hover i {
    color: var(--orange-primary, #FF6C08);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--tpt-border, #EAEAEA);
    margin: 4px 0;
}

.logout-button {
    color: var(--tpt-text, #222222);
}

.logout-button:hover {
    background-color: #FFF0F0;
    color: var(--tpt-critical, #D9381E);
}

.logout-button:hover i {
    color: var(--tpt-critical, #D9381E);
}

/* --- THEME TOGGLE BUTTON --- */

.theme-toggle {
    margin-left: auto;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--tpt-border, #EAECF0);
    border-radius: 50%;
    background: var(--tpt-surface-sunken, #F9FAFB);
    color: var(--tpt-text-subtle, #667085);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
    background: var(--tpt-accent-tint, #FFF6ED);
    border-color: var(--tpt-accent-line, #FDBA8C);
    color: var(--tpt-accent, #FF6C08);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--tpt-accent, #FF6C08);
    outline-offset: 2px;
}

/* --- THEME TRANSITIONS --- */

body,
.main-content,
.top-bar,
.tpt-card {
    transition: background-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    body,
    .main-content,
    .top-bar,
    .tpt-card,
    .theme-toggle {
        transition: none;
    }
}

/* ---- Admin layout > Top bar (layouts/application) ---- */
/* display: stays inline in the views, where the JavaScript reads and writes it. */
.profile-summary .topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #EAECF0;
    align-items: center;
    justify-content: center;
}

.profile-summary .topbar-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-summary .topbar-avatar-icon {
    font-size: 14px;
    color: #667085;
}

.profile-summary .topbar-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.profile-summary .topbar-chevron {
    font-size: 0.7rem;
}

/* ---- Sidebar > Logo (shared/_sidebar) ---- */
.logo-container .sidebar-logo-svg {
    width: 130px;
    height: auto;
}

/* ---- Internal notes > Delete button (admin/internal_notes/_delete) ---- */
/* Shared by the candidate, role and client notes tabs. */
.note-delete-button {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.72rem;
    color: var(--tpt-text-subtle);
    cursor: pointer;
}

/* ---- Candidate portal > Notice pages (public/forms/already_completed, expired, invalid_form, opt_out_confirmed) ---- */
/* The candidate portal's layout links this stylesheet and no other of ours. */
.portal-notice-icon {
    background-color: #FFF4ED;
    color: #FF6C08;
    border: 1px solid #FFDCD0;
}

.portal-notice-eyebrow {
    color: #FF6C08;
}

/* ---- Candidate portal > Withdraw button (public/forms/candidate_withdraw) ---- */
.portal-withdraw-submit {
    background-color: #D0D5DD;
}

/* ---- Candidate portal > Orange buttons (public/forms/client_interview_decision, client_document_download, client_shortlist_review, client_offer_mandate) ---- */
.portal-cta {
    background-color: #FF6C08;
}

.portal-cta:hover:not(:disabled) {
    background-color: #FF8A3A;
}
