:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.hero {
    width: 100%;
    max-width: 1500px;
    height: clamp(260px, 33vw, 500px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6) contrast(1.1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(to bottom, rgba(15,23,42,0) 0%, rgba(15,23,42,0.8) 100%);
    padding: 0 20px;
}

h1 {
    font-size: clamp(2rem, 5.5vw, 4rem);
    margin: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.accent {
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* Shared Card/Section Styles */
.content-section, .card {
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg);
    color: var(--text-main);
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.05);
}

.content-section {
    margin: -60px auto 40px;
}

.card {
    max-width: 400px;
    width: 90%;
    box-sizing: border-box;
    margin: -60px auto 40px;
}

p {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Buttons */
.cta-button, button {
    display: inline-block;
    background-color: var(--accent-color);
    color: #0f172a;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px 0 rgba(56, 189, 248, 0.39);
    cursor: pointer;
    border: none;
}

.cta-button:hover, button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

.cta-secondary {
    margin-left: 0.75rem;
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    box-shadow: none;
}

.cta-secondary:hover {
    color: #0f172a;
}

.about-content {
    max-width: 880px;
    text-align: left;
}

.about-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.about-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.about-content a:not(.cta-button) {
    color: var(--accent-color);
    font-weight: 700;
}

.about-content .cta-button {
    margin-top: 0.5rem;
}

.about-content .partner-cities {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.about-content .partner-cities li {
    margin-bottom: 0.5rem;
}

.about-intro {
    color: var(--text-main) !important;
    font-size: 1.25rem !important;
}

.btn-danger {
    background-color: transparent !important;
    color: var(--text-muted) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    box-shadow: none !important;
    display: inline-block;
    text-align: center;
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    box-shadow: none;
}

button:disabled { background: #ccc; cursor: not-allowed; }

/* Login Specifics */
h2 { 
    margin-top: 0; 
    text-align: center; 
    color: var(--accent-color);
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.form-group { margin-bottom: 1.5rem; text-align: left; }
label { display: block; margin-bottom: .5rem; font-size: 0.9rem; color: var(--text-muted); }
input { 
    width: 100%; 
    padding: .75rem; 
    box-sizing: border-box; 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 8px; 
    background: #0f172a; 
    color: white;
}

.hidden { display: none; }
.error { color: #ef4444; font-size: 0.8rem; margin-top: .5rem; text-align: center; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--card-bg);
    color: var(--text-main);
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.user-profile-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    text-decoration: none;
    z-index: 1000;
    transition: transform 0.2s ease, filter 0.2s ease;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

.user-profile-icon:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px var(--accent-color));
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal h2 {
    color: var(--accent-color);
    margin-top: 0;
    font-size: 1.5rem;
}

.modal p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.close-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--accent-color);
    color: #0f172a;
}

/* Event Calendar Styles */
.events-page .hero {
    height: clamp(180px, 20vw, 270px);
}

.events-page .hero-overlay {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    padding: 1.5rem 2rem 0;
}

.events-page .hero-overlay h1 {
    font-size: clamp(1.6rem, 4.5vw, 3rem);
}

.calendar-section {
    max-width: 1400px;
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem clamp(1rem, 3vw, 1.5rem) 2rem;
    text-align: left;
    margin: -42px auto 24px;
}

.errata-note {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.errata-note a {
    color: var(--accent-color);
    text-decoration: none;
}
.errata-note a:hover {
    text-decoration: underline;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
    position: relative;
}

.calendar-nav h2 {
    margin: 0;
    text-align: center;
    font-size: clamp(1.1rem, 3vw, 1.6rem);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.16);
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.nav-btn:hover {
    background: rgba(56, 189, 248, 0.24);
}

.feed-export-row {
    position: absolute;
    top: -1.9rem;
    right: 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.feed-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.feed-export-btn svg {
    width: 13px;
    height: 13px;
}

.feed-export-btn:hover {
    background: rgba(56, 189, 248, 0.24);
}

.calendar-wrapper {
    overflow-x: auto;
}

.calendar-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255,255,255,0.08);
}

.calendar-table th,
.calendar-table td {
    border: 1px solid rgba(255,255,255,0.08);
    padding: clamp(0.4rem, 1vw, 0.65rem);
    vertical-align: top;
    min-width: 0;
}

.calendar-table th {
    background: rgba(30, 41, 59, 0.95);
    color: var(--accent-color);
    text-align: center;
    font-size: 0.95rem;
}

.calendar-day {
    background: rgba(15, 23, 42, 0.95);
    min-height: clamp(110px, 14vw, 160px);
    cursor: context-menu;
    position: relative;
}


.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--accent-color);
}

.calendar-empty {
    background: rgba(30, 41, 59, 0.55);
}

.day-number {
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: var(--text-main);
}

.event-card {
    position: relative;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Small map-pin indicator (month view) — top-right corner, does not affect layout */
.event-loc-pin {
    position: absolute;
    top: 0.35rem;
    right: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--accent-color);
    opacity: 0.85;
    text-decoration: none;
    line-height: 1;
}

.event-loc-pin:hover {
    opacity: 1;
    transform: scale(1.15);
}

.event-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.2rem;
    overflow-wrap: anywhere;
}

/* Month-view cells are narrow: clamp long titles so cells stay compact and tidy.
   The full title is still available in the view-event modal. */
.calendar-table .event-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-time {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
}

.event-location {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    overflow-wrap: anywhere;
}

.view-event-location {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 600;
    margin: -0.5rem 0 1rem;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.view-event-location:hover {
    text-decoration: underline;
}

.event-card a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.event-card a:hover {
    text-decoration: underline;
}

/* Small per-event calendar-role tag */
.event-role-tag {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.02em;
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 999px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Role filter chips below the calendar */
.role-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.role-filter-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.15rem;
}

.role-chip {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.14);
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.role-chip:hover {
    background: rgba(56, 189, 248, 0.24);
}

.role-chip.is-off {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-muted);
    opacity: 0.6;
    text-decoration: line-through;
}

/* Career level tags on event cards (distinct hue from calendar-role tags) */
.event-level-tag {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.02em;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 999px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Level filter pills (reuse the role-filter row layout) */
.level-filter {
    margin-top: 0.5rem;
    border-top: none;
    padding-top: 0;
}

.level-chip {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.16);
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.level-chip:hover {
    background: rgba(139, 92, 246, 0.28);
}

.level-chip.is-off {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-muted);
    opacity: 0.6;
    text-decoration: line-through;
}

/* Level tags shown in the view-event modal */
.view-event-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.4rem 0;
}

/* ---- Career level tag type-ahead picker (new/edit event modals) ---- */
.level-picker {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
}

.level-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.35rem;
}

.level-picker-chips:empty {
    margin-bottom: 0;
}

.level-picker-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.35rem 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.16);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 999px;
}

.level-picker-chip-x {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0.1rem;
    opacity: 0.7;
}

.level-picker-chip-x:hover {
    opacity: 1;
}

.level-picker-input-wrap {
    position: relative;
}

.level-picker-input-wrap input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
}

.level-picker-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 180px;
    overflow-y: auto;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.level-suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.6rem;
    font-size: 0.82rem;
    color: var(--text-main);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    cursor: pointer;
}

.level-suggest-item:last-child {
    border-bottom: none;
}

.level-suggest-item:hover {
    background: rgba(139, 92, 246, 0.18);
}

@media (max-width: 768px) {
    .content-section, .card { margin: -30px 16px 40px; }
    .cta-secondary { margin: 0.75rem 0 0; }
    .calendar-section { padding: 0.4rem 0.75rem 1.25rem; margin: -24px 16px 24px; }
    .calendar-nav { flex-direction: column; }
    /* Flow the feed buttons inline above the nav instead of floating over it */
    .feed-export-row { position: static; width: 100%; justify-content: center; margin-bottom: 0.5rem; }
    .view-toggle { display: none; } /* Hide toggle on mobile, default to 7-day */
    .seven-day-card { padding: 0.8rem; }
    .seven-day-card .day-header { font-size: 1rem; }
    .event-card { padding: 0.3rem 0.4rem; margin-bottom: 0.25rem; font-size: 0.78rem; }
    .event-title { font-size: 0.82rem; }
    .event-time { font-size: 0.7rem; }
}

/* View Toggle Button */
.view-toggle {
    text-align: center;
    margin-bottom: 1rem;
}

.view-toggle button {
    background: var(--accent-color);
    color: #0f172a;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* 7-Day View Styles */
.seven-day-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.seven-day-card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.seven-day-card .day-header {
    margin: 0 0 0.75rem 0;
    font-size: 1.2rem;
    color: var(--accent-color);
    text-align: center;
}

.seven-day-card.today {
    box-shadow: inset 0 0 0 2px var(--accent-color);
}

/* Event Modal Styles (events page) */
.event-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 1rem;
}

.event-modal {
    background: var(--card-bg);
    color: var(--text-main);
    padding: 2rem;
    border-radius: 16px;
    width: 600px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    margin: auto;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.event-modal h2 { color: var(--accent-color); margin-top: 0; }
.event-modal-date { color: var(--text-muted); font-weight: 600; margin: -0.5rem 0 1.5rem; }
.event-modal .form-group { margin-bottom: 1rem; text-align: left; }
.event-modal label { display: block; margin-bottom: 5px; font-size: 0.9rem; color: var(--text-muted); }
.event-modal input, .event-modal textarea, .event-modal select {
    width: 100%; padding: 8px; border-radius: 4px; border: 1px solid #444;
    background: #0f172a; color: white; box-sizing: border-box;
}
.event-modal .btn-group { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Context Menu Styles (events page) */
.context-menu {
    display: none;
    position: fixed;
    z-index: 1001;
    background: #1e293b;
    color: white;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    min-width: 150px;
    padding: 5px 0;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: var(--accent-color);
    color: #0f172a;
}

/* View Event Modal Styles (events page) */
.view-event-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1002;
    justify-content: center;
    align-items: center;
}

.view-event-modal {
    background: var(--card-bg);
    color: var(--text-main);
    padding: 2rem;
    border-radius: 16px;
    max-width: 900px;
    width: 85%;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.view-event-modal h2 { color: var(--accent-color); margin-top: 0; }
.view-event-modal p { margin-bottom: 1rem; line-height: 1.6; }
.view-event-modal .event-body-html {
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.7;
    padding-right: 8px;
}

.view-event-modal a.event-link {
    display: inline-block;
    background: var(--accent-color);
    color: #0f172a;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
}

.view-event-modal a.event-link:hover {
    background: var(--accent-hover);
}

.view-event-modal .btn-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Mobile-optimized event view modal */
@media (max-width: 768px) {
    .view-event-modal {
        max-width: 95%;
        width: 95%;
        padding: 1.25rem;
    }
    .view-event-modal h2 { font-size: 1.4rem; }
    .view-event-modal p { font-size: 0.95rem; line-height: 1.6; }
    .view-event-modal .event-body-html {
        max-height: 300px;
        font-size: 0.95rem;
    }
    .view-event-modal a.event-link { padding: 6px 12px; font-size: 0.85rem; }
}