/**
 * Conversational Onboarding Styles
 * Mobile-first, single-column layout with modern conversational UI
 */

/* Main container */
.conversational-onboarding-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: 400px;
    max-width: 600px;
    margin: 0 auto;
    /* Prevent horizontal overflow */
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Assistant message bubble */
.assistant-message-bubble {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: slideInLeft 0.3s ease-out;
}

.assistant-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2181FF 0%, #3a55ad 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.assistant-message-text {
    flex: 1;
    background: #f8f9fa;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.assistant-message-text p {
    margin: 0 0 0.5rem 0;
}

.assistant-message-text p:last-child {
    margin-bottom: 0;
}

/* Input areas */
.conversational-input-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: slideInUp 0.3s ease-out;
}

/* Choice buttons */
.choice-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.choice-button {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 0.75rem;
    background: white;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.choice-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(4px);
}

.choice-button:active {
    transform: translateX(2px);
}

/* Text input */
.text-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.conversational-text-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.conversational-text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.conversational-submit-btn {
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #2181FF 0%, #3a55ad 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.conversational-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.signup-btn-primary {
    width: 100%;
    align-self: stretch;
    font-size: 1.125rem;
}

/* Multi-select (tags) */
.multi-select-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem;
    border: 2px dashed #e0e0e0;
    border-radius: 0.75rem;
}

.tags-container:empty::before {
    content: 'Your skills will appear here';
    color: #999;
    font-style: italic;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.remove-tag {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    padding: 0;
    transition: background 0.2s ease;
    /* Add larger touch target without affecting visual size */
    position: relative;
}

.remove-tag::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.remove-tag:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* File upload */
.file-upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.file-upload-area svg {
    margin: 0 auto 1rem;
    color: #667eea;
}

.file-upload-area p {
    margin: 0.5rem 0;
    color: #333;
    font-weight: 500;
}

.file-type-hint {
    font-size: 0.875rem;
    color: #666 !important;
    font-weight: 400 !important;
}

.file-size {
    font-size: 0.875rem;
    color: #666 !important;
    margin-top: 0.25rem !important;
}

.change-file-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.change-file-btn:hover {
    background: #667eea;
    color: white;
}

/* Error messages */
.conversational-error-message {
    padding: 0.75rem 1rem;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 0.5rem;
    color: #c33;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    .conversational-onboarding-container {
        padding: 1rem;
        gap: 1rem;
    }

    /* Ensure 44x44px minimum tap target for avatar */
    .assistant-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
    }

    .assistant-message-text {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    /* Ensure 44px minimum height for choice buttons */
    .choice-button {
        padding: 1rem 1.25rem;
        font-size: 0.9375rem;
        min-height: 44px;
    }

    .conversational-text-input {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
        min-height: 44px;
    }

    /* Ensure 44px minimum height for submit buttons */
    .conversational-submit-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
        min-height: 44px;
    }

    .file-upload-area {
        padding: 1.5rem 1rem;
    }
}

/* Ensure modal is full-height on mobile */
@media (max-width: 576px) {
    .modal.search__modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }

    .modal.search__modal .modal-content {
        height: 100%;
        border-radius: 0;
    }

    .modal.search__modal .modal-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .conversational-onboarding-container {
        min-height: auto;
        padding-bottom: 2rem;
    }
}

/* Extra small devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    .conversational-onboarding-container {
        padding: 0.875rem;
        gap: 0.875rem;
    }

    .assistant-message-text {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
    }

    .choice-button {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .conversational-text-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
    }

    .conversational-submit-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
    }

    .signup-btn-primary {
        font-size: 1rem;
    }

    .file-upload-area {
        padding: 1rem 0.75rem;
    }

    .file-upload-area p {
        font-size: 0.875rem;
    }

    .file-type-hint {
        font-size: 0.75rem !important;
    }
}

/* Prevent horizontal scroll globally */
.modal.search__modal .modal-body * {
    max-width: 100%;
}

.conversational-onboarding-container * {
    box-sizing: border-box;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .assistant-message-text {
        background: #2a2a2a;
        color: #e0e0e0;
    }

    .choice-button {
        background: #1e1e1e;
        border-color: #444;
        color: #e0e0e0;
    }

    .choice-button:hover {
        background: #2a2a3e;
        border-color: #667eea;
    }

    .conversational-text-input {
        background: #1e1e1e;
        border-color: #444;
        color: #e0e0e0;
    }

    .file-upload-area {
        background: #1e1e1e;
        border-color: #444;
    }

    .file-upload-area:hover {
        background: #2a2a3e;
    }
}

/* ========================================
   PREMIUM TRANSITION POLISH
   ======================================== */

/* Premium spring-like easing for polished transitions */
:root {
    --premium-easing: cubic-bezier(0.16, 1, 0.3, 1);
    --exit-duration: 350ms;
    --entrance-duration: 500ms;
    --background-transition-duration: 600ms;
}

/* Exit animation for conversational container */
.conversational-onboarding-container.exiting {
    opacity: 0;
    transform: scale(0.98) translateY(-10px);
    transition: all var(--exit-duration) var(--premium-easing);
    pointer-events: none;
}

/* Modal background transition states - Light theme */
.modal-body.transitioning-to-preview {
    background: #f8f9fa;
    transition: background var(--background-transition-duration) var(--premium-easing);
}

.modal-body.preview-mode {
    background: #f8f9fa;
    transition: background var(--background-transition-duration) var(--premium-easing);
}

/* Staggered choice button animations */
.choice-buttons-container .choice-button {
    opacity: 0;
    animation: buttonSlideIn 0.4s var(--premium-easing) forwards;
}

.choice-buttons-container .choice-button:nth-child(1) { animation-delay: 0ms; }
.choice-buttons-container .choice-button:nth-child(2) { animation-delay: 50ms; }
.choice-buttons-container .choice-button:nth-child(3) { animation-delay: 100ms; }
.choice-buttons-container .choice-button:nth-child(4) { animation-delay: 150ms; }

@keyframes buttonSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Progress indicator styles */
.onboarding-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
    z-index: 10;
    transition: background var(--background-transition-duration) var(--premium-easing);
}

.onboarding-progress-bar.dark-mode {
    background: rgba(0, 0, 0, 0.05);
}

.onboarding-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2181FF, #667eea);
    transition: width 0.4s var(--premium-easing);
    border-radius: 0 2px 2px 0;
}

/* Keep same blue gradient for preview mode - matches light theme */
.onboarding-progress-bar.dark-mode .onboarding-progress-fill {
    background: linear-gradient(90deg, #2181FF, #667eea);
}

/* Assistant avatar morph animation - subtle pulse for light theme */
.assistant-avatar.transitioning {
    animation: avatarMorph 0.6s var(--premium-easing) forwards;
}

@keyframes avatarMorph {
    0% {
        background: linear-gradient(135deg, #2181FF, #3a55ad);
        box-shadow: 0 4px 12px rgba(33, 129, 255, 0.3);
    }
    100% {
        background: linear-gradient(135deg, #667eea, #2181FF);
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
}

/* Staggered preview element entrance */
.preview-unlock-container .preview-header,
.preview-unlock-container .preview-cta-section,
.preview-unlock-container .preview-grid,
.preview-unlock-container .whats-waiting-section,
.preview-unlock-container .preview-subtitle,
.preview-unlock-container .features-grid {
    opacity: 0;
    transform: translateY(20px);
}

.preview-unlock-container.loaded .preview-header {
    animation: fadeInUp 0.5s var(--premium-easing) forwards;
    animation-delay: 0ms;
}

.preview-unlock-container.loaded .preview-cta-section {
    animation: fadeInUp 0.5s var(--premium-easing) forwards;
    animation-delay: 80ms;
}

.preview-unlock-container.loaded .preview-grid {
    animation: fadeInUp 0.5s var(--premium-easing) forwards;
    animation-delay: 160ms;
}

.preview-unlock-container.loaded .whats-waiting-section {
    animation: fadeInUp 0.5s var(--premium-easing) forwards;
    animation-delay: 240ms;
}

.preview-unlock-container.loaded .preview-subtitle {
    animation: fadeInUp 0.5s var(--premium-easing) forwards;
    animation-delay: 320ms;
}

.preview-unlock-container.loaded .features-grid {
    animation: fadeInUp 0.5s var(--premium-easing) forwards;
    animation-delay: 400ms;
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .conversational-onboarding-container.exiting,
    .modal-body.transitioning-to-preview,
    .modal-body.preview-mode,
    .choice-buttons-container .choice-button,
    .onboarding-progress-fill,
    .assistant-avatar.transitioning,
    .preview-unlock-container .preview-header,
    .preview-unlock-container .preview-cta-section,
    .preview-unlock-container .preview-grid,
    .preview-unlock-container .whats-waiting-section,
    .preview-unlock-container .preview-subtitle,
    .preview-unlock-container .features-grid {
        animation: none !important;
        transition: opacity 0.1s linear !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .conversational-onboarding-container.exiting {
        opacity: 0 !important;
    }
}

/* Loading state */
.conversational-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.conversational-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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