/* 
 * Waypoint Chat Interface - Clean & Professional
 * White & Charcoal Theme with Montserrat Typography
 * Mobile-first responsive design
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    /* Clean White & Charcoal Palette */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --black: #111111;
    
    --accent: #1a3a6b;
    --accent-light: #2a5aa8;
    --accent-dark: #0d2040;
    --accent-glow: rgba(26, 58, 107, 0.12);
    --accent-subtle: rgba(26, 58, 107, 0.06);
    
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-inverse: #ffffff;
    
    --success-color: #16a34a;
    --error-color: #dc2626;
    
    --border-color: #e5e7eb;
    --border-accent: rgba(26, 58, 107, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-accent: 0 4px 14px rgba(26, 58, 107, 0.18);
    --shadow-glow: 0 0 40px rgba(26, 58, 107, 0.07);
    
    /* Typography */
    --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-premium: 'Montserrat', serif;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Legacy aliases for compatibility */
    --primary-color: var(--accent);
    --primary-dark: var(--accent-dark);
    --gradient-primary: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);

    /* Backwards-compat aliases used in selectors */
    --copper: var(--accent);
    --copper-light: var(--accent-light);
    --copper-dark: var(--accent-dark);
    --copper-glow: var(--accent-glow);
    --copper-subtle: var(--accent-subtle);
    --border-copper: var(--border-accent);
    --shadow-copper: var(--shadow-accent);
    --midnight-black: var(--white);
    --midnight-dark: var(--gray-50);
    --midnight-medium: var(--gray-100);
    --midnight-light: var(--gray-100);
    --midnight-lighter: var(--gray-200);
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(160deg, #f8f9fb 0%, #eef0f4 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== App Container ========== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 100%;
    background: var(--white);
    position: relative;
    overflow: hidden;
}

/* Desktop styling */
@media (min-width: 768px) {
    .app-container {
        max-width: 700px;
        margin: 2rem auto;
        height: calc(100vh - 4rem);
        border-radius: 20px;
        border: 1px solid var(--border-color);
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 800px;
    }
}

/* ========== Header ========== */
.chat-header {
    background: var(--white);
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    flex-shrink: 0;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.25;
}

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

.header-content--centered {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 0.75rem;
}

.header-content--centered .header-text h1 {
    text-align: left;
}

.header-content--centered .header-text .status {
    text-align: left;
    display: block;
}

@media (min-width: 480px) {
    .header-content {
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    .header-content {
        gap: 1.5rem;
    }
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: var(--success-color);
    border-radius: 50%;
    border: 2px solid var(--white);
}

@media (min-width: 480px) {
    .avatar {
        width: 42px;
        height: 42px;
    }
}

@media (min-width: 768px) {
    .avatar {
        width: 44px;
        height: 44px;
    }
}

.neo-avatar {
    background: linear-gradient(145deg, #d8e8f8 0%, #b0ccee 100%);
    box-shadow: var(--shadow-accent);
}

.user-avatar {
    background: var(--gray-200);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.header-text h1 {
    font-family: var(--font-family);
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 480px) {
    .header-text h1 {
        font-size: 1.125rem;
        letter-spacing: 0.3px;
    }
}

@media (min-width: 768px) {
    .header-text h1 {
        font-size: 1.25rem;
        letter-spacing: 0.5px;
    }
}

.header-text .status {
    font-family: var(--font-family);
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-top: 0.125rem;
    display: block;
}

@media (min-width: 480px) {
    .header-text .status {
        font-size: 0.6875rem;
    }
}

@media (min-width: 768px) {
    .header-text .status {
        font-size: 0.75rem;
    }
}

/* Progress Bar */
.progress-container {
    height: 3px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* ========== Chat Messages ========== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scroll-behavior: smooth;
    background: var(--white);
}

@media (min-width: 768px) {
    .chat-messages {
        padding: 2rem;
        gap: 1.5rem;
    }
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ========== Message Bubbles ========== */
.message {
    display: flex;
    gap: 0.875rem;
    max-width: 90%;
    animation: messageSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .message {
        max-width: 80%;
    }
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.message-avatar--neo {
    background: linear-gradient(145deg, #d4e6f7 0%, #a8ccef 100%);
}

.message-avatar--user {
    background: linear-gradient(145deg, #f1f4f8 0%, #d5dce7 100%);
    border: 1px solid var(--border-color);
}

.message-content {
    padding: 1rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.2px;
}

.message.bot .message-content {
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    border-bottom-left-radius: 6px;
    color: var(--text-primary);
}

.message.user .message-content {
    background: var(--accent);
    color: var(--text-inverse);
    border-bottom-right-radius: 6px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 0.5rem;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingPulse 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* ========== Input Area ========== */
.chat-input-area {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .chat-input-area {
        padding: 1.25rem;
    }
}

@media (min-width: 768px) {
    .chat-input-area {
        padding: 1.5rem 2rem;
    }
}

/* Text Input */
.text-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

#userInput {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: 28px;
    font-size: 0.9375rem;
    font-family: var(--font-family);
    font-weight: 400;
    background: var(--white);
    color: var(--text-primary);
    transition: all var(--transition-base);
    outline: none;
    box-shadow: var(--shadow-sm);
}

#userInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
    background: var(--white);
}

#userInput::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.send-btn {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: var(--text-inverse);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.send-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-accent);
}

.send-btn:not(:disabled):active {
    transform: scale(0.98);
}

/* ========== Choice Options ========== */
.choice-options-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .choice-options-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

.choice-option-btn {
    padding: 0.75rem 1.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: 24px;
    background: var(--white);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 480px) {
    .choice-option-btn {
        flex: 0 1 auto;
        min-width: 140px;
    }
}

.choice-option-btn:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.choice-option-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-accent);
}

/* ========== Job Cards (Conjoint) ========== */
/* 
 * Side-by-side layout on ALL screen sizes for unbiased A/B testing.
 * Uses CSS Grid with proper responsive breakpoints.
 * Cards stretch to fill available height with scrollable content.
 * VS divider hidden on mobile, shown on tablet+.
 */

.job-cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem 0;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    height: 100%;
}

/* On mobile, VS divider is hidden so cards span adjacent columns */
.job-cards-container .job-card:first-child {
    grid-column: 1;
}

.job-cards-container .job-card:last-child {
    grid-column: 2;
}

/* Tablet and up: Show VS divider column */
@media (min-width: 768px) {
    .job-cards-container {
        grid-template-columns: 1fr auto 1fr;
        gap: 1rem;
    }
    
    .job-cards-container .job-card:first-child {
        grid-column: 1;
    }
    
    .job-cards-container .job-card:last-child {
        grid-column: 3;
    }
}

/* Desktop: More breathing room */
@media (min-width: 1024px) {
    .job-cards-container {
        gap: 1.5rem;
    }
}

/* ========== Job Card ========== */
.job-card {
    background: var(--white);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 140px);
}

@media (min-width: 480px) {
    .job-card {
        border-radius: 10px;
    }
}

@media (min-width: 768px) {
    .job-card {
        border-radius: 12px;
    }
}

@media (min-width: 1024px) {
    .job-card {
        border-radius: 16px;
    }
}

.job-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .job-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }
}

.job-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-accent);
}

/* ========== Card Header ========== */
.card-header {
    background: var(--gray-50);
    padding: 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

@media (min-width: 480px) {
    .card-header {
        padding: 0.625rem 0.75rem;
    }
}

@media (min-width: 768px) {
    .card-header {
        padding: 0.875rem 1rem;
    }
}

@media (min-width: 1024px) {
    .card-header {
        padding: 1rem 1.25rem;
    }
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 1px;
    background: var(--accent);
    border-radius: 1px;
}

@media (min-width: 480px) {
    .card-header::after {
        width: 24px;
    }
}

@media (min-width: 768px) {
    .card-header::after {
        width: 32px;
        height: 2px;
    }
}

@media (min-width: 1024px) {
    .card-header::after {
        width: 40px;
    }
}

/* ========== Card Label ========== */
.card-label {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.625rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@media (min-width: 480px) {
    .card-label {
        font-size: 0.6875rem;
        letter-spacing: 0.75px;
    }
}

@media (min-width: 768px) {
    .card-label {
        font-size: 0.875rem;
        letter-spacing: 1px;
    }
}

@media (min-width: 1024px) {
    .card-label {
        font-size: 1rem;
    }
}

/* ========== Card Content ========== */
.card-content {
    padding: 0.375rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* Important for flex scroll */
}

/* Custom scrollbar for card content */
.card-content::-webkit-scrollbar {
    width: 4px;
}

.card-content::-webkit-scrollbar-track {
    background: transparent;
}

.card-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
    opacity: 0.5;
}

.card-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

@media (min-width: 480px) {
    .card-content {
        padding: 0.625rem;
        gap: 0.5rem;
    }
    
    .card-content::-webkit-scrollbar {
        width: 5px;
    }
}

@media (min-width: 768px) {
    .card-content {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .card-content::-webkit-scrollbar {
        width: 6px;
    }
}

@media (min-width: 1024px) {
    .card-content {
        padding: 1.25rem;
        gap: 1rem;
    }
}

/* ========== Job Attributes ========== */
.job-attribute {
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.job-attribute:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

@media (min-width: 480px) {
    .job-attribute {
        padding-bottom: 0.5rem;
    }
}

@media (min-width: 768px) {
    .job-attribute {
        padding-bottom: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .job-attribute {
        padding-bottom: 0.875rem;
    }
}

/* ========== Attribute Label ========== */
.attribute-label {
    display: block;
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.125rem;
}

@media (min-width: 480px) {
    .attribute-label {
        font-size: 0.5625rem;
        letter-spacing: 0.5px;
        margin-bottom: 0.1875rem;
    }
}

@media (min-width: 768px) {
    .attribute-label {
        font-size: 0.625rem;
        letter-spacing: 0.75px;
        margin-bottom: 0.25rem;
    }
}

@media (min-width: 1024px) {
    .attribute-label {
        font-size: 0.6875rem;
        letter-spacing: 0.8px;
        margin-bottom: 0.375rem;
    }
}

/* ========== Attribute Value ========== */
.attribute-value {
    font-size: 0.625rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 480px) {
    .attribute-value {
        font-size: 0.6875rem;
        line-height: 1.35;
    }
}

@media (min-width: 768px) {
    .attribute-value {
        font-size: 0.8125rem;
        line-height: 1.4;
    }
}

@media (min-width: 1024px) {
    .attribute-value {
        font-size: 0.875rem;
        line-height: 1.5;
    }
}

/* Description values (secondary styling) */
.attribute-value.description {
    color: var(--text-secondary);
}

/* Culture statement (quote styling) */
.attribute-value.culture-statement {
    font-style: italic;
    color: var(--text-secondary);
    padding-left: 0.375rem;
    border-left: 2px solid var(--accent);
}

@media (min-width: 768px) {
    .attribute-value.culture-statement {
        padding-left: 0.625rem;
    }
}

@media (min-width: 1024px) {
    .attribute-value.culture-statement {
        padding-left: 0.75rem;
    }
}

/* Long text attributes - show full text with secondary styling */
.job-attribute.long-text .attribute-value {
    color: var(--text-secondary);
    line-height: 1.25;
}

/* ========== Select Button ========== */
.select-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
    color: var(--accent);
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: var(--font-family);
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .select-btn {
        padding: 0.875rem;
        font-size: 0.75rem;
        letter-spacing: 0.75px;
    }
}

@media (min-width: 768px) {
    .select-btn {
        padding: 0.875rem;
        font-size: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .select-btn {
        padding: 1rem;
        font-size: 0.875rem;
        letter-spacing: 0.5px;
    }
}

.job-card:hover .select-btn {
    background: var(--accent);
    color: var(--text-inverse);
}

.job-card.selected .select-btn {
    background: var(--accent);
    color: var(--text-inverse);
}

/* ========== VS Divider ========== */
.vs-divider {
    display: none; /* Hidden on mobile - grid collapses */
    align-items: center;
    justify-content: center;
    grid-column: 2; /* Explicitly place in middle column when visible */
}

@media (min-width: 768px) {
    .vs-divider {
        display: flex; /* Show on tablet+ */
    }
}

.vs-divider span {
    background: var(--gray-100);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.625rem;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-color);
}

@media (min-width: 1024px) {
    .vs-divider span {
        width: 40px;
        height: 40px;
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
}

/* ========== Round Counter ========== */
.round-counter {
    text-align: center;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .round-counter {
        padding: 0.75rem;
        font-size: 0.8125rem;
        letter-spacing: 0.5px;
        margin-bottom: 0.5rem;
    }
}

.round-counter strong {
    color: var(--accent);
}

/* ========== Loading Overlay ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Conjoint Prompt (in footer) ========== */
.conjoint-prompt {
    text-align: center;
    padding: 0.75rem;
}

.prompt-text {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ========== Job Cards Overlay (Full Screen Scrollable) ========== */
.job-cards-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #f4f5f7 0%, var(--white) 100%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.job-cards-header {
    background: var(--white);
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .job-cards-header {
        padding: 1.25rem 2rem;
    }
}

.round-info {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.round-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.round-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.round-total {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comparison-label {
    font-size: 0.6875rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

@media (min-width: 768px) {
    .round-number {
        font-size: 2rem;
    }
    
    .comparison-label {
        font-size: 0.75rem;
    }
}

/* ========== Conjoint Progress Bar ========== */
.conjoint-progress-container {
    height: 3px;
    background: var(--gray-200);
    overflow: hidden;
    flex-shrink: 0;
}

.conjoint-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.conjoint-motivation {
    text-align: center;
    padding: 0.45rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-dark);
    background: linear-gradient(90deg, rgba(26, 58, 107, 0.07), rgba(26, 58, 107, 0.02));
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid rgba(26, 58, 107, 0.18);
    flex-shrink: 0;
    letter-spacing: 0.15px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.conjoint-progress-label {
    text-align: center;
    padding: 0.375rem 1rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--white);
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.job-cards-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

@media (min-width: 768px) {
    .job-cards-scroll {
        padding: 1.5rem 2rem;
        align-items: stretch;
    }
}

/* Update job cards container for overlay context */
.job-cards-overlay .job-cards-container {
    max-width: 800px;
    width: 100%;
}

/* ========== Completion Page ========== */
.completion-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, #f4f7fb 0%, var(--white) 60%, #eef3fa 100%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.completion-container {
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.completion-header {
    margin-bottom: 2.5rem;
}

.completion-icon-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(26, 58, 107, 0.28);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(26, 58, 107, 0.22);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 40px rgba(26, 58, 107, 0.32);
        transform: scale(1.03);
    }
}

.completion-check {
    width: 40px;
    height: 40px;
    color: var(--text-inverse);
    stroke-width: 2.5;
}

.completion-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
    margin-bottom: 0.375rem;
}

.completion-subtitle {
    font-size: 0.8125rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

@media (min-width: 768px) {
    .completion-icon-wrapper {
        width: 88px;
        height: 88px;
    }
    
    .completion-check {
        width: 44px;
        height: 44px;
    }
    
    .completion-title {
        font-size: 2.25rem;
    }
    
    .completion-subtitle {
        font-size: 0.875rem;
    }
}

.completion-content {
    background: var(--white);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .completion-content {
        padding: 2.5rem 2rem;
    }
}

.completion-message {
    margin-bottom: 2rem;
}

.completion-message p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.completion-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.375rem;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

@media (min-width: 768px) {
    .stat-value {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

.completion-note p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
}

.completion-footer {
    opacity: 0.6;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.footer-divider {
    width: 40px;
    height: 1px;
    background: var(--border-color);
    margin: 0 auto 0.75rem;
}

.session-id {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: monospace;
}

.session-id span {
    color: var(--accent);
}

/* ========== Utility Classes ========== */
.hidden {
    display: none !important;
}

/* ========== Mobile Optimizations ========== */
@media (max-width: 480px) {
    .chat-header {
        padding: 1rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .chat-input-area {
        padding: 1rem;
    }
    
    .message {
        max-width: 92%;
    }
    
    .message-content {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Note: Job card styles are now handled in the Job Cards section with proper breakpoints */
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .chat-input-area {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
    
    .job-cards-scroll {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    
    .completion-page {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Choice "Other" Input ========== */
.choice-other-btn {
    border-style: dashed !important;
    opacity: 0.8;
}

.other-input-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0 0.5rem;
}

.other-input-container.hidden {
    display: none;
}

.other-text-input {
    flex: 1;
    background: var(--white);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.other-text-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.other-text-input::placeholder {
    color: var(--text-muted);
}

.other-submit-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    color: var(--text-inverse);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast);
}

.other-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========== File Upload UI ========== */
.file-upload-container {
    padding: 1rem;
    width: 100%;
}

.file-drop-zone {
    border: 2px dashed var(--border-copper);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--copper-subtle);
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--copper);
    background: var(--copper-glow);
    transform: scale(1.01);
}

.drop-zone-content svg {
    color: var(--copper);
    margin-bottom: 0.75rem;
}

.drop-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.drop-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-input-hidden {
    display: none;
}

.file-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
}

.file-selected.hidden {
    display: none;
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    color: var(--text-inverse);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--transition-fast);
}

.file-upload-btn:hover {
    transform: scale(1.03);
}

.skip-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.skip-btn:hover {
    color: var(--text-secondary);
    border-color: var(--text-muted);
}

/* ========== Ranking UI (Drag to Rank) ========== */
.ranking-container {
    padding: 0.75rem 0;
    width: 100%;
    max-width: 100%;
}

.ranking-instruction {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.625rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.ranking-items {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.7rem 0.85rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.ranking-item:active {
    cursor: grabbing;
}

.ranking-item:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.ranking-item.dragging {
    opacity: 0.4;
    border-color: var(--accent);
    transform: scale(1.02);
    box-shadow: var(--shadow-accent);
}

/* Floating clone for touch drag */
.ranking-item.drag-clone {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.25);
    border-color: var(--accent);
    background: var(--white);
}

/* Placeholder gap during touch drag */
.ranking-placeholder {
    border: 2px dashed var(--accent);
    border-radius: 12px;
    background: var(--accent-subtle);
    opacity: 0.5;
    transition: height 0.15s ease;
}

.ranking-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.ranking-item:hover .ranking-handle {
    opacity: 1;
    color: var(--accent-light);
}

.ranking-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: 1px solid var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-inverse);
    flex-shrink: 0;
    transition: all var(--transition-base);
}

.ranking-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

.ranking-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.ranking-submit-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    color: var(--text-inverse);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ranking-submit-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-accent);
}

/* ========== Conjoint Transition Animations ========== */
.job-cards-overlay {
    transition: opacity 0.35s ease;
}

.job-cards-overlay.fade-out {
    opacity: 0;
}

.job-card.not-chosen {
    opacity: 0.35;
    transform: scale(0.97);
    transition: all 0.4s ease;
}

.job-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-accent);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

/* ========== Number Input ========== */
#userInput[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

#userInput[type="number"]::-webkit-outer-spin-button,
#userInput[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ========== Responsive adjustments for new UI ========== */
@media (max-width: 480px) {
    .ranking-item {
        padding: 0.75rem 0.85rem;
    }
    
    .file-drop-zone {
        padding: 1.5rem 1rem;
    }
    
    .ranking-label {
        font-size: 0.85rem;
    }
}
