/* WorkReady Portal — single-page student workstation */

:root {
    /* Default WorkReady brand (pre-hire) */
    --sim-primary: #2557a7;
    --sim-primary-dark: #1a3f7a;
    --sim-secondary: #334155;
    --sim-accent: #ff6b35;
    --sim-bg: #f5f5f5;
    --sim-white: #ffffff;
    --sim-text: #2d2d2d;
    --sim-muted: #6f6f6f;
    --sim-border: #e4e4e4;
    --sim-radius: 8px;
    --sim-shadow: rgba(0, 0, 0, 0.08);
}

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

html {
    overflow-y: scroll;  /* always show scrollbar to prevent layout shift between views */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--sim-text);
    background: var(--sim-bg);
    line-height: 1.6;
    min-height: 100vh;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.hidden { display: none !important; }

/* --- Brand --- */
.brand {
    font-size: 1.6rem;
    font-weight: 800;
    text-decoration: none;
}
.brand-work { color: var(--sim-primary); }
.brand-ready { color: var(--sim-accent); }
.brand-suffix {
    color: var(--sim-muted);
    font-weight: 400;
    font-size: 0.7em;
    letter-spacing: 0.08em;
    margin-left: 0.4rem;
    text-transform: uppercase;
}
.brand-link { text-decoration: none; }

/* --- Sign-in screen --- */
.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.signin-card {
    background: var(--sim-white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--sim-shadow);
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.signin-card .brand {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.signin-tagline {
    color: var(--sim-muted);
    margin-bottom: 2rem;
}

.signin-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.signin-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sim-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.signin-form input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--sim-border);
    border-radius: var(--sim-radius);
    font-size: 1rem;
    font-family: inherit;
}

.signin-form input:focus {
    outline: none;
    border-color: var(--sim-primary);
    box-shadow: 0 0 0 3px rgba(37, 87, 167, 0.15);
}

.signin-help {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--sim-muted);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--sim-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--sim-primary);
    color: white;
    margin-top: 1rem;
}
.btn-primary:hover { background: var(--sim-primary-dark); }

.btn-link {
    background: transparent;
    color: var(--sim-muted);
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}
.btn-link:hover { color: var(--sim-text); }

/* --- App shell --- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.header {
    background: var(--sim-white);
    border-bottom: 1px solid var(--sim-border);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.state-badge {
    position: relative;
    padding: 0.3rem 0.8rem;
    background: var(--sim-bg);
    border: 1px solid var(--sim-border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sim-muted);
    cursor: help;
}

.state-badge.state-hired {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #15803d;
}

/* Tooltip on the state badge */
.state-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 100;
    background: var(--sim-primary);
    color: white;
    padding: 0.85rem 1rem;
    border-radius: var(--sim-radius);
    box-shadow: 0 4px 12px rgba(37, 87, 167, 0.25);
    font-size: 0.85rem;
    font-weight: 400;
    white-space: normal;
    width: 320px;
    transition: opacity 0.15s, visibility 0.15s;
    text-align: left;
}

.state-badge:hover .state-tooltip,
.state-badge:focus .state-tooltip,
.state-badge:focus-within .state-tooltip {
    visibility: visible;
    opacity: 1;
}

.state-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 1rem;
    border: 6px solid transparent;
    border-bottom-color: var(--sim-primary);
}

.state-tooltip strong {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
}

.state-tooltip ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.state-tooltip li {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
}

.state-tooltip .tt-state {
    color: white;
    font-weight: 600;
}

.user-name {
    font-size: 0.95rem;
    color: var(--sim-text);
    font-weight: 500;
}

/* --- Main layout --- */
.main {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 3rem;
    flex: 1;
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    background: var(--sim-white);
    border-radius: var(--sim-radius);
    padding: 1rem;
    height: fit-content;
    border: 1px solid var(--sim-border);
}

.nav { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1.5rem; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: transparent;
    border: none;
    border-radius: var(--sim-radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--sim-text);
    cursor: pointer;
    text-align: left;
    position: relative;
}

.nav-item:hover {
    background: var(--sim-bg);
}

.nav-item.active {
    background: var(--sim-primary);
    color: white;
}

.nav-icon {
    font-size: 1.1rem;
}

.badge {
    margin-left: auto;
    background: var(--sim-accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-section h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--sim-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0 0.8rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.8rem;
    color: var(--sim-text);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--sim-radius);
}
.sidebar-link:hover { background: var(--sim-bg); }

/* --- Content --- */
.content {
    background: var(--sim-white);
    border-radius: var(--sim-radius);
    padding: 2rem;
    border: 1px solid var(--sim-border);
}

.view h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.view-subtitle {
    color: var(--sim-muted);
    margin-bottom: 1.5rem;
}

/* --- Dashboard --- */
.dashboard-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--sim-muted);
}

.dashboard-empty h3 {
    color: var(--sim-text);
    margin-bottom: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn { margin-top: 0; }

.app-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }

.app-card {
    border: 1px solid var(--sim-border);
    border-left: 4px solid var(--sim-primary);
    border-radius: var(--sim-radius);
    padding: 1rem 1.25rem;
    background: var(--sim-bg);
}

.app-card-title { font-weight: 600; }
.app-card-meta { color: var(--sim-muted); font-size: 0.9rem; margin-top: 0.25rem; }
.app-stage {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: var(--sim-white);
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* --- Message list --- */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-item {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border: 1px solid var(--sim-border);
    border-radius: var(--sim-radius);
    cursor: pointer;
    background: var(--sim-white);
    transition: background 0.15s;
}

.message-item:hover {
    background: var(--sim-bg);
}

.message-item.unread {
    border-left: 4px solid var(--sim-primary);
    background: rgba(37, 87, 167, 0.03);
}

.message-item.unread .message-subject {
    font-weight: 700;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-weight: 600;
    font-size: 0.95rem;
}

.message-date {
    font-size: 0.85rem;
    color: var(--sim-muted);
}

.message-subject {
    font-size: 0.95rem;
}

.message-preview {
    color: var(--sim-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-inbox {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--sim-muted);
}

/* --- Modal --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1000;
}

.modal-content {
    background: var(--sim-white);
    border-radius: var(--sim-radius);
    padding: 2rem;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--sim-muted);
    line-height: 1;
}

.modal-meta { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--sim-border); }
.modal-meta h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.modal-from { font-size: 0.9rem; color: var(--sim-muted); }
.modal-from span { color: var(--sim-text); }
.modal-date { font-size: 0.85rem; color: var(--sim-muted); margin-top: 0.25rem; }
.modal-body { white-space: pre-wrap; line-height: 1.7; }

/* --- Primer view (iframe inside main content area) --- */
.view-primer {
    /* Remove the inner padding from .content for this view */
    margin: -2rem;
    height: calc(100% + 4rem);
    min-height: 70vh;
    display: flex;
}

.primer-iframe {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
    min-height: 70vh;
    background: var(--sim-bg);
    border-radius: var(--sim-radius);
}

/* Sidebar buttons (not links) need to look the same */
button.sidebar-link {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--sim-muted);
    font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .main { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; gap: 0.75rem; }
}
