/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties for iOS Safari */
:root {
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --mobile-header-height: 60px;
}

/* Unified font family declaration for easier maintenance */
html, body, input, textarea, select, button {
    font-family: 'ClashGrotesk-Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: 'ClashGrotesk-Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #121212;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    padding: 0;
    margin: 0;
    color: #FFFFFF;
}

/* Main container - full screen layout */
.app-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    display: flex;
    overflow: hidden;
}

/* Sidebar - Chat History */
.sidebar {
    width: 280px;
    background: #121212;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid #333;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #333;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 8px 0;
}

.logo-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.05);
}

.logo-text {
    font-family: 'ClashGrotesk-Bold';
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #284B63, #284B63, #284B63);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGradientShift 4s ease-in-out infinite;
}

@keyframes logoGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Enterprise logo enhancements */
.logo-icon svg {
    filter: drop-shadow(0 2px 4px rgba(187, 134, 252, 0.2));
}

/* Subtle pulse animation for data flow indicators */
.logo-icon svg circle[fill="#03DAC6"] {
    filter: drop-shadow(0 0 2px #D9D9D9);
}

.tagline {
    font-family: 'ClashGrotesk-Medium';
    font-size: 12px;
    color: #999;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
    margin-bottom: 4px;
}

.new-chat-btn {
    width: calc(100% - 32px);
    padding: 12px 16px;
    background: #121212;
    border: 1px solid #FFFFFF;
    border-radius: 8px;
    color: #FFFFFF;
    font-family: 'ClashGrotesk-Medium';
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin: 16px;
    margin-bottom: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}

.history-section {
    margin-bottom: 24px;
}

.history-title {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-left: 4px;
}

.chat-item {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 2px;
    cursor: pointer;
    font-size: 14px;
    color: #ccc;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-close-btn {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #C42021;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 2px;
}

.chat-item:hover .chat-close-btn {
    opacity: 1;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #C42021;
}

.chat-item:hover {
    background: #333;
}

.chat-item.active {
    background: #121212;
    border: 1px solid #FFFFFF;
    color: #FFFFFF;
}

.no-chats {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #121212;
}

/* Top header with model selection */
.main-header {
    padding: 16px 24px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #121212;
}

.header-spacer {
    flex-grow: 1; /* Fill remaining space on desktop */
    height: 44px;
    min-width: 0; /* Allow shrinking if needed */
}

@media (max-width: 768px) {
    .header-spacer {
        flex-grow: 0; /* Don't grow on mobile */
        width: 44px; /* Fixed width for hamburger menu space */
        flex-shrink: 0; /* Don't shrink on mobile */
    }
}

/* Modern Custom Dropdown Styles */
.model-selector-modern {
    position: relative;
    min-width: 220px;
}

.model-selector-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(40, 75, 99, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(40, 75, 99, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-selector-trigger:hover {
    background: rgba(40, 75, 99, 0.15);
    border-color: rgba(40, 75, 99, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 75, 99, 0.2);
}

.model-selector-trigger.active {
    background: rgba(40, 75, 99, 0.2);
    border-color: #284B63;
    box-shadow: 0 4px 20px rgba(40, 75, 99, 0.3);
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-provider {
    font-size: 10px;
    font-family: 'ClashGrotesk-Medium';
    color: #284B63;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-name {
    font-size: 14px;
    font-family: 'ClashGrotesk-Regular';
    color: #FFFFFF;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    color: #999;
}

.model-selector-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
    color: #284B63;
}

/* Dropdown Panel */
.model-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(40, 75, 99, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.model-dropdown-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Search Input */
.model-search {
    padding: 12px;
    border-bottom: 1px solid rgba(40, 75, 99, 0.2);
    position: relative;
}

.search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.model-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: rgba(40, 75, 99, 0.05);
    border: 1px solid rgba(40, 75, 99, 0.2);
    border-radius: 8px;
    color: #FFFFFF;
    font-family: 'ClashGrotesk-Regular';
    font-size: 13px;
    transition: all 0.2s ease;
}

.model-search-input:focus {
    outline: none;
    background: rgba(40, 75, 99, 0.1);
    border-color: #284B63;
}

.model-search-input::placeholder {
    color: #666;
}

/* Model List */
.model-list {
    overflow-y: auto;
    max-height: 300px;
    padding: 8px;
}

.model-list::-webkit-scrollbar {
    width: 6px;
}

.model-list::-webkit-scrollbar-track {
    background: transparent;
}

.model-list::-webkit-scrollbar-thumb {
    background: rgba(40, 75, 99, 0.3);
    border-radius: 3px;
}

.model-list::-webkit-scrollbar-thumb:hover {
    background: rgba(40, 75, 99, 0.5);
}

/* Model Groups */
.model-group {
    margin-bottom: 12px;
}

.model-group:last-child {
    margin-bottom: 0;
}

.model-group-header {
    font-size: 11px;
    font-family: 'ClashGrotesk-Medium';
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    margin-bottom: 4px;
}

/* Model Options */
.model-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.model-option:hover {
    background: rgba(40, 75, 99, 0.1);
}

.model-option.selected {
    background: rgba(40, 75, 99, 0.15);
}

.model-option.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #284B63;
    border-radius: 0 2px 2px 0;
}

.model-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-option-name {
    font-size: 13px;
    font-family: 'ClashGrotesk-Regular';
    color: #FFFFFF;
}

.model-option-provider {
    font-size: 10px;
    color: #666;
}

/* Provider Badge Colors - Applied dynamically from config */

/* Header settings button */
.header-settings-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 8px;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.header-settings-btn:hover {
    background: #284B63;
    border-color: #555;
    color: #FFFFFF;
}

.header-settings-btn:active {
    background: rgba(187, 134, 252, 0.2);
    transform: scale(0.98);
}

/* Chat section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

/* Chat messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    scroll-behavior: smooth;
    min-height: 0;
}

.message {
    margin-bottom: 16px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
}

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

.message.user {
    margin-left: auto;
}

.message.ai {
    margin-right: auto;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.message.user .message-bubble {
    background: #121212;
    border: 1px solid #D9D9D9;
    color: #FFFFFF;
    border-bottom-right-radius: 6px;
    font-family: 'ClashGrotesk-Regular';
}

.message.ai .message-bubble {
    background: #1E1E1E;
    border: 1px solid #333;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    color: #FFFFFF;
    font-family: 'ClashGrotesk-Regular';
}

/* Personality indicator badge */
.personality-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    background: #121212;
    border-radius: 8px;
    margin-bottom: 4px;
    color: #3C5B71;
    font-family: 'ClashGrotesk-Medium';
    font-weight: 500;
}

.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.message.user .message-attachments {
    justify-content: flex-end;
}

.message-attachment {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(18, 18, 18, 0.85);
    border: 1px solid #2b2b2b;
    border-radius: 12px;
    padding: 10px;
    max-width: 240px;
    transition: border-color 0.2s, transform 0.2s;
}

.message-attachment:hover {
    border-color: #284B63;
    transform: translateY(-1px);
}

.message-attachment.image img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #333;
    display: block;
}

.message-attachment-link {
    color: #BB86FC;
    font-size: 13px;
    word-break: break-all;
    text-decoration: none;
}

.message-attachment-link:hover {
    text-decoration: underline;
}

.message-attachment-name {
    font-size: 12px;
    color: #FFFFFF;
    font-family: 'ClashGrotesk-Medium';
    word-break: break-word;
}

.message-attachment-meta {
    font-size: 11px;
    color: #9E9E9E;
}

.message-attachment-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #1E1E1E;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #BB86FC;
    font-family: 'ClashGrotesk-Medium';
}

/* Chat input area */
.chat-input-area {
    padding: 24px;
    padding-bottom: calc(24px + var(--safe-area-bottom));
    background: #121212;
    border-top: 1px solid #333;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: sticky;
    bottom: 0;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    border: 2px solid #333;
    border-radius: 24px;
    font-size: 16px;
    resize: none;
    font-family: 'ClashGrotesk-Regular';
    background: #1E1E1E;
    color: #FFFFFF;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: #284B63;
}

.send-button {
    width: 44px;
    height: 44px;
    background: #284B63;
    border: none;
    border-radius: 50%;
    color: #D9D9D9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-button:hover {
    background: #284B63;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(187, 134, 252, 0.3);
}

.send-button:active {
    transform: scale(0.95);
}

.attachment-button {
    width: 44px;
    height: 44px;
    background: #1E1E1E;
    border: 2px solid #333;
    border-radius: 12px;
    color: #c5c5c5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.attachment-button:hover {
    border-color: #284B63;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(40, 75, 99, 0.25);
}

.attachment-button:active {
    transform: scale(0.94);
}

.attachment-input {
    display: none;
}

.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.attachment-preview:empty {
    display: none;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 8px 12px;
    position: relative;
    max-width: 220px;
    overflow: hidden;
}

.attachment-item.image .attachment-thumb img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #333;
}

.attachment-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #1E1E1E;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #BB86FC;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
}

.attachment-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.attachment-name {
    font-size: 13px;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'ClashGrotesk-Medium';
}

.attachment-size {
    font-size: 11px;
    color: #9E9E9E;
}

.attachment-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent;
    border: none;
    color: #9e9e9e;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

.attachment-remove:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.attachment-feedback {
    font-size: 12px;
    color: #9E9E9E;
    margin-bottom: 12px;
    min-height: 16px;
}

.attachment-feedback.error {
    color: #CF6679;
}

.attachment-feedback.warning {
    color: #F5A623;
}

/* Anti-Sycophancy Control Panel */
.control-panel {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: #121212;
    border-left: 1px solid #333;
    box-shadow: -2px 0 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    z-index: 1050;
}

.control-panel.open {
    right: 0;
}


.panel-header {
    padding: 20px;
    background: #121212;
    border-bottom: 1px solid #333;
}

.panel-title {
    font-family: 'ClashGrotesk-Medium';
    font-size: 18px;
    font-weight: 500;
    color: #D9D9D9;
    margin-bottom: 4px;
}

.panel-subtitle {
    font-family: 'ClashGrotesk-Regular';
    font-size: 13px;
    color: #999;
    line-height: 1.4;
}

.controls-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Context Selector Group */
.context-selector-group {
    margin-bottom: 24px;
    padding: 20px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 12px;
    transition: all 0.2s;
}

.context-selector-group:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
}

.context-selector-label {
    margin-bottom: 16px;
}

.context-selector-title {
    font-family: 'ClashGrotesk-Semibold';
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    display: block;
    margin-bottom: 4px;
}

.context-selector-description {
    font-family: 'ClashGrotesk-Regular';
    font-size: 13px;
    color: #999;
    line-height: 1.4;
}

.context-selector-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.context-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #555;
    border-radius: 8px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'ClashGrotesk-Medium';
    font-size: 12px;
    font-weight: 500;
}

.context-btn:hover {
    background: transparent;
    border-color: rgba(187, 134, 252, 0.3);
    color: #ccc;
}

.context-btn.active {
    background: rgba(187, 134, 252, 0.15);
    border-color: #284B63;
    color: #284B63;
}

.context-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.context-btn-text {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#dynamicParametersContainer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Parameter controls */
.parameter-group {
    margin-bottom: 24px;
}

.parameter-label {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 8px;
}

.parameter-name {
    font-family: 'ClashGrotesk-Regular';
    font-weight: 400;
    color: #FFFFFF;
    font-size: 14px;
}

.parameter-value {
    font-family: 'ClashGrotesk-Regular';
    font-size: 13px;
    color: #D9D9D9;
    font-weight: 400;
    background: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.parameter-description {
    font-family: 'ClashGrotesk-Regular';
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    line-height: 1.3;
}

/* Custom slider styling */
.slider-container {
    position: relative;
    margin-bottom: 8px;
    height: 20px;
    display: flex;
    align-items: center;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.slider::-webkit-slider-track {
    height: 6px;
    border-radius: 3px;
    background: transparent;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000000;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s;
    border: 2px solid #FFFFFF;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: none;
}

.slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

.slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: transparent;
    border: none;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000000;
    cursor: pointer;
    border: 2px solid #FFFFFF;
    box-shadow: none;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: none;
}

/* Slider track progress */
.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    height: 6px;
    background: linear-gradient(90deg, #D9D9D9, #D9D9D9);
    border-radius: 3px;
    pointer-events: none;
    transition: width 0.3s ease;
    transform: translateY(-50%);
    z-index: 1;
}

/* Apply changes button */
.apply-button {
    width: 100%;
    padding: 14px;
    background: #284B63;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    border-radius: 8px;
    font-family: 'ClashGrotesk-Semibold';
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
    min-height: 48px;
}

.apply-button:hover {
    background: transparent;
}

.apply-button:active {
    transform: translateY(0);
}

.apply-button.applied {
    background: #284B63;
    color: #FFFFFF;
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Active Profile Summary */
.profile-summary {
    background: transparent;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.profile-summary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
}

.profile-summary-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}


.profile-info {
    flex: 1;
}

.profile-title {
    font-family: 'ClashGrotesk-Semibold';
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 2px;
}

.profile-context {
    font-family: 'ClashGrotesk-Medium';
    font-size: 11px;
    font-weight: 500;
    color: #D9D9D9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}




/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        width: 100%;
    }

    
    .mobile-reconfigure-btn {
        display: flex;
    }

    .control-panel {
        width: 100%;
        right: -100%;
        height: 100dvh; /* Dynamic viewport height */
        top: 0;
        padding-top: var(--safe-area-top);
        padding-bottom: var(--safe-area-bottom);
    }
    
    .controls-container {
        padding-bottom: calc(120px + var(--safe-area-bottom)); /* Increased space for Apply button */
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
        position: relative;
    }
    
    /* Add fade gradient above Apply button */
    .controls-container::after {
        content: '';
        position: absolute;
        bottom: calc(80px + var(--safe-area-bottom));
        left: 0;
        right: 0;
        height: 20px;
        background: linear-gradient(transparent, rgba(18, 18, 18, 0.9));
        pointer-events: none;
        z-index: 1;
    }

    /* Responsive header adjustments */
    .main-header {
        padding: 12px 16px;
        gap: 12px;
    }

    .model-selector-modern {
        min-width: 180px;
        margin-left: 60px; /* Space for hamburger menu button */
    }
    
    .model-selector-trigger {
        padding: 10px 14px;
    }
    
    .model-name {
        font-size: 13px;
    }
    
    .model-provider {
        font-size: 9px;
    }

    .header-settings-btn {
        width: 40px;
        height: 40px;
    }

    .chat-messages,
    .chat-input-area {
        padding-left: 16px;
        padding-right: 16px;
    }

    .slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    .control-panel .apply-button {
        min-height: 52px;
        position: fixed;
        bottom: calc(24px + var(--safe-area-bottom));
        left: 24px;
        right: 24px;
        width: calc(100% - 48px);
        margin: 0;
        background: #284B63;
        backdrop-filter: blur(10px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 2; /* Above the gradient */
        display: none; /* Hidden by default */
    }
    
    .control-panel.open .apply-button {
        display: block; /* Show only when panel is open */
    }
}

/* Tooltip System */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1F1F1F;
    color: #FFFFFF;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #1F1F1F;
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #333;
    color: #999;
    font-size: 10px;
    margin-left: 8px;
    cursor: help;
    transition: all 0.2s ease;
}

.tooltip-icon:hover {
    background: #284B63;
    color: #FFFFFF;
}

/* Parameter label with tooltip */
.parameter-label-with-tooltip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.parameter-label-with-tooltip .parameter-label {
    margin-bottom: 0;
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .tooltip-content {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 280px;
        z-index: 1002;
    }
    
    .tooltip-content::after {
        display: none;
    }
}

/* Mobile menu button - default mobile styling */
.mobile-menu-btn {
    display: none; /* Hidden by default */
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important; /* Force show on mobile */
        position: fixed;
        top: calc(16px + var(--safe-area-top));
        left: calc(16px + var(--safe-area-left));
        width: 44px;
        height: 44px;
        background: #121212;
        border: 1px solid #555;
        border-radius: 8px;
        color: #FFFFFF;
        cursor: pointer;
        z-index: 1001;
    }
    
    /* Hide mobile menu button when control panel is open */
    body.control-panel-open .mobile-menu-btn {
        display: none !important;
    }
}

/* Mobile menu button - hidden on desktop */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Loading and typing indicators */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #284B63;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Markdown formatted content styles */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    font-family: 'ClashGrotesk-Semibold';
    margin: 16px 0 8px 0;
    line-height: 1.3;
}

.message-bubble h1 { font-size: 1.5em; color: #284B63; }
.message-bubble h2 { font-size: 1.3em; color: #284B63; }
.message-bubble h3 { font-size: 1.15em; }
.message-bubble h4 { font-size: 1.05em; }
.message-bubble h5 { font-size: 0.95em; }
.message-bubble h6 { font-size: 0.9em; }

.message-bubble p {
    margin: 8px 0;
    line-height: 1.6;
}

.message-bubble ul,
.message-bubble ol {
    margin: 8px 0;
    padding-left: 24px;
}

.message-bubble li {
    margin: 4px 0;
    line-height: 1.6;
}

.message-bubble blockquote {
    border-left: 3px solid #284B63;
    padding-left: 16px;
    margin: 12px 0;
    color: #ccc;
    font-style: italic;
}

.message-bubble code {
    font-family: 'Courier New', Courier, monospace;
    background: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #D9D9D9;
}

.message-bubble pre {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
}

.message-bubble pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: #e6edf3;
    font-size: 0.875em;
    line-height: 1.5;
}

.message-bubble a {
    color: #284B63;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.message-bubble a:hover {
    border-bottom-color: #284B63;
}

.message-bubble hr {
    border: none;
    border-top: 1px solid #333;
    margin: 16px 0;
}

.message-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.message-bubble th,
.message-bubble td {
    border: 1px solid #333;
    padding: 8px 12px;
    text-align: left;
}

.message-bubble th {
    background: transparent;
    font-weight: 600;
}

.message-bubble strong {
    font-family: 'ClashGrotesk-Semibold';
    font-weight: 600;
    color: #fff;
}

.message-bubble em {
    font-style: italic;
    color: #e6e6e6;
}

/* Utility classes */
.hidden { display: none; }
.disabled { opacity: 0.5; pointer-events: none; }

/* Placeholder and option styling for dark theme */
.chat-input::placeholder {
    color: #999;
    font-family: 'ClashGrotesk-Regular';
}


/* Onboard Button Styling */
.onboard-btn {
    width: calc(100% - 32px);
    padding: 12px 16px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 8px;
    color: #FFFFFF;
    font-family: 'ClashGrotesk-Medium';
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin: 16px;
    margin-top: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    position: relative;
}

.onboard-btn:hover {
    background: #284B63;
    border-color: #555;
    color: #FFFFFF;
}

.onboard-btn:active {
    transform: translateY(0);
}

/* Mobile Reconfigure Button */
.mobile-reconfigure-btn {
    width: calc(100% - 32px);
    padding: 12px 16px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 8px;
    color: #FFFFFF;
    font-family: 'ClashGrotesk-Medium';
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin: 8px 16px 16px 16px;
    transition: all 0.2s;
    display: none; /* Hidden by default, shown on mobile */
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.mobile-reconfigure-btn:hover {
    background: #284B63;
    border-color: #555;
    color: #FFFFFF;
}

.mobile-reconfigure-btn:active {
    transform: translateY(0);
}

/* Onboard Modal Styling */
.onboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.onboard-modal.show {
    opacity: 1;
    visibility: visible;
}

.onboard-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.onboard-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.onboard-content {
    background: #1E1E1E;
    border: 1px solid #333;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.onboard-modal.show .onboard-content {
    transform: translateY(0) scale(1);
}

/* Close Button */
.onboard-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 8px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.onboard-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #777;
    color: #fff;
}

/* Modal Header */
.onboard-header {
    text-align: center;
    padding: 40px 40px 32px 40px;
    border-bottom: 1px solid #333;
}

.onboard-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #284B63, #284B63);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    color: #000;
}

.onboard-title {
    font-family: 'ClashGrotesk-Medium';
    font-size: 28px;
    font-weight: 500;
    color: #D9D9D9;
    margin: 0 0 8px 0;
}

.onboard-subtitle {
    font-family: 'ClashGrotesk-Regular';
    font-size: 16px;
    color: #999;
    margin: 0;
    line-height: 1.5;
}

/* Modal Body */
.onboard-body {
    padding: 32px 40px;
}

.onboard-intro {
    text-align: center;
    margin-bottom: 32px;
}

.onboard-intro p {
    font-family: 'ClashGrotesk-Regular';
    font-size: 15px;
    color: #ccc;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.onboard-intro p:last-child {
    margin-bottom: 0;
}

/* Features List */
.onboard-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 12px;
    transition: all 0.2s;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
}


.feature-text h4 {
    font-family: 'ClashGrotesk-Medium';
    font-size: 16px;
    font-weight: 500;
    color: #D9D9D9;
    margin: 0 0 4px 0;
}

.feature-text p {
    font-family: 'ClashGrotesk-Regular';
    font-size: 14px;
    color: #999;
    line-height: 1.5;
    margin: 0;
}

/* Modal Footer */
.onboard-footer {
    padding: 24px 40px 40px 40px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.onboard-skip {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 8px;
    color: #999;
    font-family: 'ClashGrotesk-Medium';
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.onboard-skip:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #777;
    color: #ccc;
}

.onboard-start {
    padding: 12px 24px;
    background: #284B63;
    border: 1px solid #FFFFFF;
    border-radius: 8px;
    color: #FFFFFF;
    font-family: 'ClashGrotesk-Semibold';
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.onboard-start:hover {
    background: transparent;
}

.onboard-start:active {
    transform: translateY(0);
}

/* Questionnaire Specific Styles */
.onboard-screen {
    transition: all 0.3s ease;
}

.onboard-screen.hidden {
    display: none;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 32px;
    padding: 0 8px;
    margin-top: 60px; /* Increased margin to prevent overlap with close button (40px + 16px + 4px buffer) */
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #D9D9D9, #284B63);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-family: 'ClashGrotesk-Medium';
    font-size: 14px;
    color: #999;
    font-weight: 500;
}

/* Question Container */
.question-container {
    padding: 0 8px;
}

/* Context-specific question styling */
.question-container.personal-context {
    --context-color: #FF6B9D;
    --context-color-light: rgba(255, 107, 157, 0.1);
    --context-color-border: rgba(255, 107, 157, 0.3);
}

.question-container.professional-context {
    --context-color: #4FC3F7;
    --context-color-light: rgba(79, 195, 247, 0.1);
    --context-color-border: rgba(79, 195, 247, 0.3);
}

.question-container.mixed-context {
    --context-color: #81C784;
    --context-color-light: rgba(129, 199, 132, 0.1);
    --context-color-border: rgba(129, 199, 132, 0.3);
}

.question-container.personal-context .question-scenario {
    background: transparent;
    border: none;
}

.question-container.professional-context .question-scenario {
    background: transparent;
    border: none;
}

.question-container.mixed-context .question-scenario {
    background: transparent;
    border: none;
}

/* Context indicator for questions */
.context-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid rgba(187, 134, 252, 0.2);
    border-radius: 12px;
    font-family: 'ClashGrotesk-Medium';
    font-size: 11px;
    font-weight: 500;
    color: #284B63;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.context-indicator.personal-context {
    background: rgba(255, 107, 157, 0.1);
    border-color: rgba(255, 107, 157, 0.2);
    color: #FF6B9D;
}

.context-indicator.professional-context {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.2);
    color: #4FC3F7;
}

.context-indicator.mixed-context {
    background: rgba(129, 199, 132, 0.1);
    border-color: rgba(129, 199, 132, 0.2);
    color: #81C784;
}

.context-indicator-icon {
    font-size: 12px;
}

.question-title {
    font-family: 'ClashGrotesk-Medium';
    font-size: 20px;
    font-weight: 500;
    color: #D9D9D9;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.question-scenario {
    font-family: 'ClashGrotesk-Regular';
    font-size: 16px;
    color: #ccc;
    line-height: 1.6;
    margin: 0 0 28px 0;
    padding: 20px;
    background: transparent;
    border: none;
    border-radius: 0;
}

/* Context Selection Styling */
.answer-options.context-selection {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: none;
}

.context-option {
    position: relative;
}

.context-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid #333;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
}

.context-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
}

.context-card.selected {
    background: rgba(255, 255, 255, 0.05);
    border-color: #284B63;
}



.context-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.context-title {
    font-family: 'ClashGrotesk-Medium';
    font-size: 20px;
    font-weight: 500;
    color: #D9D9D9;
    margin: 0;
    line-height: 1.2;
}

.context-text {
    font-family: 'ClashGrotesk-Regular';
    font-size: 15px;
    color: #ccc;
    margin: 0;
    line-height: 1.4;
}

.context-description {
    font-family: 'ClashGrotesk-Medium';
    font-size: 13px;
    color: #999;
    margin: 0;
    line-height: 1.3;
    font-style: italic;
}

.context-card.selected .context-text {
    color: #e6e6e6;
}

.context-card.selected .context-description {
    color: #284B63;
}

.context-selector {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.context-card .radio-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #555;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.context-card:hover .radio-custom {
    border-color: #284B63;
}

.context-card.selected .radio-custom {
    border-color: #284B63;
    background: #284B63;
}

.context-card.selected .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #D9D9D9;
    border-radius: 50%;
}

.context-preview {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 3px solid #81929E;
}

.context-preview-title {
    font-family: 'ClashGrotesk-Semibold';
    font-size: 12px;
    font-weight: 600;
    color: #D9D9D9;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.context-preview-params {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preview-param {
    display: inline-block;
    padding: 3px 8px;
    background: transparent;
    color: #D9D9D9;
    font-family: 'ClashGrotesk-Medium';
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid #555;
}

.context-card.selected .preview-param {
    background: transparent;
    color: #FFFFFF;
    border-color: #284B63;
}

/* Answer Options (for regular questions) */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 16px;
}

.answer-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
}

.answer-option.selected {
    background: rgba(255, 255, 255, 0.05);
    border-color: #284B63;
}

.answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #555;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.answer-option:hover .radio-custom {
    border-color: #284B63;
}

.answer-option.selected .radio-custom {
    border-color: #284B63;
    background: #284B63;
}

.answer-option.selected .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #D9D9D9;
    border-radius: 50%;
}

.answer-text {
    font-family: 'ClashGrotesk-Regular';
    font-size: 15px;
    color: #e6e6e6;
    line-height: 1.5;
    flex: 1;
}

.answer-option.selected .answer-text {
    color: #ffffff;
}

/* Navigation Buttons */
.footer-section {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    width: 100%;
}

.footer-section.hidden {
    display: none;
}

.nav-button {
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'ClashGrotesk-Medium';
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    border: none;
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.nav-button.secondary {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
}

.nav-button.secondary:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #777;
    color: #fff;
}

.nav-button.primary {
    background: #284B63;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    margin-left: auto;
}

.nav-button.primary:not(:disabled):hover {
    background: transparent;
}

.nav-button:active:not(:disabled) {
    transform: translateY(0);
}

/* Results Screen Styles */
.results-container {
    text-align: center;
    padding: 0 8px;
}

.results-icon {
    width: 80px;
    height: 80px;
    background: #284B63;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    color: #FFFFFF;
    animation: successPulse 2s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.results-title {
    font-family: 'ClashGrotesk-Medium';
    font-size: 24px;
    font-weight: 500;
    color: #D9D9D9;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.results-subtitle {
    font-family: 'ClashGrotesk-Regular';
    font-size: 16px;
    color: #ccc;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

/* Parameter Results */
.parameter-results {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
    text-align: left;
}

.parameter-result {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.parameter-result:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
}

.parameter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.parameter-results .parameter-name {
    font-family: 'ClashGrotesk-Regular';
    font-size: 16px;
    font-weight: 400;
    color: #FFFFFF;
}

.parameter-results .parameter-value {
    font-family: 'ClashGrotesk-Regular';
    font-size: 17px;
    font-weight: 400;
    color: #D9D9D9;
    background: transparent;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 40px;
    text-align: center;
}

.parameter-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.parameter-fill {
    height: 100%;
    background: linear-gradient(90deg, #284B63, #284B63);
    border-radius: 4px;
    transition: width 1s ease;
    animation: fillAnimation 1.5s ease-out;
}

@keyframes fillAnimation {
    0% { width: 0% !important; }
}

.parameter-description {
    font-family: 'ClashGrotesk-Regular';
    font-size: 14px;
    color: #999;
    line-height: 1.4;
}

/* Context indication in results */
.results-context-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(187, 134, 252, 0.2);
    border-radius: 16px;
    font-family: 'ClashGrotesk-Medium';
    font-size: 12px;
    font-weight: 500;
    color: #284B63;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.results-context-indicator.personal-context {
    background: rgba(255, 107, 157, 0.1);
    border-color: rgba(255, 107, 157, 0.2);
    color: #FF6B9D;
}

.results-context-indicator.professional-context {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.2);
    color: #4FC3F7;
}

.results-context-indicator.mixed-context {
    background: rgba(129, 199, 132, 0.1);
    border-color: rgba(129, 199, 132, 0.2);
    color: #81C784;
}

/* Example responses section */
.example-responses {
    margin: 32px 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
}

.example-responses h4 {
    font-family: 'ClashGrotesk-Semibold';
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.example-responses-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.example-response-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 16px;
    position: relative;
}

.example-prompt {
    font-family: 'ClashGrotesk-Medium';
    font-size: 13px;
    font-weight: 500;
    color: #999;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.example-text {
    font-family: 'ClashGrotesk-Regular';
    font-size: 14px;
    color: #e6e6e6;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
    position: relative;
    padding-left: 16px;
}

.example-text::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 18px;
    color: #284B63;
    font-weight: bold;
}

.example-text::after {
    content: '"';
    font-size: 18px;
    color: #284B63;
    font-weight: bold;
    margin-left: 4px;
}

/* Personality Summary */
.personality-summary {
    background: transparent;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.personality-summary h4 {
    font-family: 'ClashGrotesk-Medium';
    font-size: 18px;
    font-weight: 500;
    color: #D9D9D9;
    margin: 0 0 16px 0;
}

.personality-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.trait {
    display: inline-block;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 20px;
    font-family: 'ClashGrotesk-Medium';
    font-size: 12px;
    color: #D9D9D9;
    font-weight: 500;
    color: #284B63;
    animation: traitAppear 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

.trait:nth-child(1) { animation-delay: 0.1s; }
.trait:nth-child(2) { animation-delay: 0.2s; }
.trait:nth-child(3) { animation-delay: 0.3s; }
.trait:nth-child(4) { animation-delay: 0.4s; }
.trait:nth-child(5) { animation-delay: 0.5s; }

@keyframes traitAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.personality-description {
    font-family: 'ClashGrotesk-Regular';
    font-size: 15px;
    color: #ccc;
    line-height: 1.6;
    margin: 0;
}

/* Animation for screen transitions */
.onboard-screen {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

.onboard-screen.slide-out-left {
    opacity: 0;
    transform: translateX(-30px);
}

.onboard-screen.slide-in-right {
    opacity: 0;
    transform: translateX(30px);
}

/* Responsive Design for Onboard Modal */
@media (max-width: 768px) {
    .onboard-container {
        padding: 16px;
    }
    
    .onboard-content {
        border-radius: 12px;
        max-height: 95vh;
    }
    
    .onboard-header {
        padding: 32px 24px 24px 24px;
    }
    
    .onboard-title {
        font-size: 24px;
    }
    
    .onboard-subtitle {
        font-size: 15px;
    }
    
    .onboard-body {
        padding: 24px;
    }
    
    .onboard-footer {
        padding: 20px 24px 32px 24px;
        flex-direction: column;
    }
    
    .onboard-skip,
    .onboard-start {
        width: 100%;
        justify-content: center;
    }
    
    .feature-item {
        padding: 16px;
    }
    
    
    /* Mobile questionnaire adjustments */
    .question-title {
        font-size: 18px;
    }
    
    .question-scenario {
        font-size: 15px;
        padding: 16px;
    }
    
    .answer-option {
        padding: 14px 16px;
    }
    
    .answer-text {
        font-size: 14px;
    }
    
    .footer-section {
        flex-direction: column;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
    
    .nav-button.primary {
        margin-left: 0;
        order: 1;
    }
    
    .nav-button.secondary {
        order: 2;
    }
    
    /* Mobile results screen adjustments */
    .results-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 20px;
    }
    
    .results-title {
        font-size: 20px;
    }
    
    .results-subtitle {
        font-size: 15px;
    }
    
    .parameter-result {
        padding: 16px;
    }
    
    .parameter-results .parameter-name {
        font-size: 15px;
        font-family: 'ClashGrotesk-Regular';
        font-weight: 400;
    }
    
    .parameter-results .parameter-value {
        font-size: 15px;
        font-family: 'ClashGrotesk-Regular';
        font-weight: 400;
        color: #D9D9D9;
    }
    
    .personality-summary {
        padding: 20px;
    }
    
    .personality-summary h4 {
        font-size: 16px;
    }
    
    .trait {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .personality-description {
        font-size: 14px;
    }

    /* Mobile context selection responsive styles */
    .context-card {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        padding: 20px;
    }


    .context-content {
        gap: 6px;
    }

    .context-title {
        font-size: 18px;
    }

    .context-text {
        font-size: 14px;
    }

    .context-description {
        font-size: 12px;
    }

    .context-preview {
        padding: 10px;
        margin-top: 8px;
    }

    .context-preview-title {
        font-size: 11px;
    }

    .preview-param {
        font-size: 10px;
        padding: 2px 6px;
    }

    .context-selector {
        margin-top: 8px;
    }

    /* Mobile context indicators */
    .context-indicator {
        font-size: 10px;
        padding: 3px 6px;
        margin-bottom: 12px;
    }

    .results-context-indicator {
        font-size: 11px;
        padding: 5px 10px;
        margin-bottom: 12px;
    }

    /* Mobile example responses */
    .example-responses {
        padding: 20px;
        margin: 24px 0;
    }

    .example-responses h4 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .example-response-item {
        padding: 14px;
    }

    .example-prompt {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .example-text {
        font-size: 13px;
        padding-left: 12px;
    }

    .example-text::before,
    .example-text::after {
        font-size: 16px;
    }
}

/* Additional responsive breakpoint for very small screens */
@media (max-width: 480px) {
    .onboard-content {
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }

    .onboard-container {
        padding: 0;
        align-items: stretch;
    }

    .context-card {
        padding: 16px;
    }


    .context-title {
        font-size: 16px;
    }

    .context-text {
        font-size: 13px;
    }

    .preview-param {
        font-size: 9px;
        padding: 1px 4px;
    }

    .example-responses {
        padding: 16px;
    }

    .example-text {
        font-size: 12px;
        line-height: 1.4;
    }
}

/* Enhanced Animations and Transitions */
@keyframes contextCardPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes contextIconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
    60% { transform: translateY(-2px); }
}

@keyframes parameterPreviewSlide {
    0% { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes exampleResponseFadeIn {
    0% { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes contextIndicatorGlow {
    0% { box-shadow: 0 0 0 rgba(187, 134, 252, 0); }
    50% { box-shadow: 0 0 8px rgba(187, 134, 252, 0.3); }
    100% { box-shadow: 0 0 0 rgba(187, 134, 252, 0); }
}

@keyframes resultsSlideUp {
    0% { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Apply animations to elements */
.context-card.selected {
    animation: contextCardPulse 0.6s ease-out;
}


.context-preview {
    animation: parameterPreviewSlide 0.4s ease-out 0.2s both;
}

.example-response-item {
    animation: exampleResponseFadeIn 0.5s ease-out;
}

.example-response-item:nth-child(1) { animation-delay: 0.1s; }
.example-response-item:nth-child(2) { animation-delay: 0.2s; }
.example-response-item:nth-child(3) { animation-delay: 0.3s; }

.context-indicator {
    animation: contextIndicatorGlow 2s ease-in-out infinite;
}

.results-context-indicator {
    animation: resultsSlideUp 0.5s ease-out, contextIndicatorGlow 3s ease-in-out infinite 1s;
}

.example-responses {
    animation: resultsSlideUp 0.6s ease-out 0.3s both;
}

.personality-summary {
    animation: resultsSlideUp 0.6s ease-out 0.5s both;
}

/* Enhanced transitions for better micro-interactions */
.context-card .radio-custom {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.context-card.selected .radio-custom {
    transform: scale(1.1);
}

.preview-param {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.context-card:hover .preview-param {
    transform: translateY(-1px);
}

.context-card.selected .preview-param {
    transform: translateY(-1px);
}

.parameter-fill {
    animation: fillAnimation 1.5s ease-out, shimmer 2s ease-in-out infinite 2s;
}

@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

.parameter-fill {
    background: linear-gradient(90deg, #284B63, #284B63, #284B63);
    background-size: 200% 100%;
}

/* Smooth question transitions */
.question-container {
    transition: all 0.4s ease;
}

.question-title {
    transition: color 0.3s ease;
}

/* Enhanced hover states */
.answer-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.answer-option:hover {
    transform: translateX(4px);
}

.answer-option.selected {
    transform: translateX(4px) scale(1.01);
}

/* Progress bar enhancements */
.progress-fill {
    background: linear-gradient(90deg, #D9D9D9, #284B63);
    background-size: 200% 100%;
    animation: progressShine 4s ease-in-out infinite;
}

@keyframes progressShine {
    0% { background-position: -100% 0; }
    50% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #121212;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
