/* --- Global & Typography --- */
.upstart-pilot-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; padding: 20px; border-radius: 12px; }
#ideaquest-ai-app { max-width: 1400px; margin: 40px auto; background-color: #ffffff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 30px 40px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); }
#ideaquest-ai-app h2 { font-size: 24px; color: #111827; margin-bottom: 8px; }
#ideaquest-ai-app p { font-size: 16px; color: #6b7280; }
strong { font-weight: 600; color: #374151; }

/* --- Tabs, Progress Bar, Forms --- */
.tab-content { display: none; }
.tab-content.active { display: block; }
.progress-bar { display: flex; justify-content: space-between; margin-bottom: 40px; border-bottom: 1px solid #e5e7eb; padding-bottom: 20px; }
.step { display: flex; flex-direction: column; align-items: center; color: #9ca3af; font-weight: 500; font-size: 14px; flex-grow: 1; position: relative; }
.step:not(:last-child)::after { content: ''; position: absolute; top: 12px; left: 50%; width: 100%; height: 2px; background-color: #e5e7eb; z-index: -1; }
.step .step-icon { font-size: 24px; margin-bottom: 8px; background: #fff; padding: 0 10px; }
.step.active { color: #4f46e5; font-weight: 600; }
.form-header { text-align: center; margin-bottom: 30px; }
.form-header p { line-height: 1.6; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; color: #374151; margin-bottom: 8px; }
.input-with-button, .input-with-icon { position: relative; display: flex; }
input[type="text"] { width: 100%; padding: 12px 15px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 16px; }
input[type="text"]:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.input-with-icon input[type="text"] { padding-left: 40px; }
.input-with-icon .fas { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.input-with-button input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.input-with-button button { padding: 0 20px; border: 1px solid #4f46e5; background-color: #4f46e5; color: #ffffff; border-top-right-radius: 6px; border-bottom-right-radius: 6px; cursor: pointer; font-weight: 600; }
#skills-tags-container { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag { background-color: #e0e7ff; color: #4338ca; padding: 6px 12px; border-radius: 16px; font-size: 14px; font-weight: 500; display: flex; align-items: center; }
.skill-tag .remove-skill { margin-left: 8px; cursor: pointer; font-weight: bold; }
.form-footer { margin-top: 40px; display: flex; justify-content: flex-end; }
.form-footer.space-between { justify-content: space-between; }
.nav-btn { background-color: #4f46e5; color: white; padding: 12px 25px; border: none; border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.nav-btn:hover:not(:disabled) { background-color: #4338ca; }
.nav-btn:disabled { background-color: #a5b4fc; cursor: not-allowed; opacity: 0.7; }
.nav-btn.prev-btn { background-color: #e5e7eb; color: #374151; }
.nav-btn.prev-btn:hover { background-color: #d1d5db; }
.loading-spinner { text-align: center; padding: 40px 0; }
.spinner { border: 4px solid #f3f3f3; border-top: 4px solid #4f46e5; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 15px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.error-message { text-align: center; background-color: #fee2e2; color: #b91c1c; padding: 15px; border-radius: 6px; border: 1px solid #fecaca; }

/* --- Tab 2: Choose a Path --- */
#path-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.path-card { background-color: #fff; border: 2px solid #e5e7eb; border-radius: 8px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s; }
.path-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.07); }
.path-card.selected { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.path-card .icon { font-size: 32px; color: #4f46e5; margin-bottom: 15px; }
.path-description-wrapper { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 15px; }
.path-description-text { font-size: 14px; color: #6b7280; line-height: 1.5; font-weight: 600; }
.path-description-input { font-size: 14px; width: 100%; border: 1px solid #a5b4fc; border-radius: 4px; padding: 5px; resize: vertical; }
.edit-path-desc { cursor: pointer; color: #9ca3af; transition: color 0.2s; }
.edit-path-desc:hover { color: #4f46e5; }
.market-signal { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.market-signal[data-signal="High"] { background-color: #d1fae5; color: #065f46; }
.market-signal[data-signal="Medium"] { background-color: #fef3c7; color: #92400e; }
.market-signal[data-signal="Low"] { background-color: #fee2e2; color: #991b1b; }

/* --- Tab 3: Choose Audience --- */
#audience-list-container { display: flex; flex-direction: column; gap: 15px; }
.audience-item { border: 1px solid #e5e7eb; border-radius: 8px; transition: all 0.2s; }
.audience-item .audience-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; cursor: pointer; }
.audience-item .audience-name { font-weight: 600; color: #111827; margin-right: 20px; }
.audience-item .select-btn { background-color: #e5e7eb; color: #374151; border: none; padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.audience-item .select-btn i { margin-left: 8px; transition: transform 0.2s; }
.audience-item.selected { border-color: #4f46e5; background-color: #f9fafb; }
.audience-item.selected .select-btn { background-color: #4f46e5; color: #fff; }
.audience-item.selected .select-btn i { transform: rotate(180deg); }
.audience-details { display: none; padding: 0 20px 20px 20px; }
.audience-item.selected .audience-details { display: block; border-top: 1px solid #e5e7eb; margin-top: 20px; padding-top: 20px; }
.audience-details-actions { display: -webkit-inline-box; flex-direction: column; align-items: flex-start; gap: 15px; }
.audience-details-btn { background: #fff; border: 1px solid #d1d5db; color: #374151; padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.audience-details-btn .fas { color: #4f46e5; }
.audience-details-btn:disabled { background-color: #f9fafb; color: #9ca3af; cursor: not-allowed; }
.audience-details-btn:disabled .fas { color: #9ca3af; }

/* --- Tab 4: Identify Problems --- */
#problem-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.problem-card { background-color: #fff; border: 2px solid #e5e7eb; border-radius: 8px; padding: 20px; cursor: pointer; transition: all 0.2s; display: block; justify-content: space-between; align-items: center; }
.problem-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.07); }
.problem-card.selected { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.problem-card .problem-statement { font-weight: 600; color: #111827; margin-right: 15px; }
.problem-card .pain-score-container { text-align: center; flex-shrink: 0; padding-top: 15px; }
.problem-card .pain-score-label { font-size: 12px; color: #6b7280; }
.problem-card .pain-score { font-size: 24px; font-weight: bold; color: #4f46e5; }

/* --- Tab 5: Brainstorm Solutions --- */
.solutions-filter-bar { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.filter-btn { background-color: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; padding: 8px 16px; border-radius: 20px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.filter-btn:hover { background-color: #e5e7eb; }
.filter-btn.active { background-color: #4f46e5; color: #fff; border-color: #4f46e5; }
#solution-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.solution-card { background-color: #fff; border: 2px solid #e5e7eb; border-radius: 8px; padding: 20px; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; }
.solution-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.07); }
.solution-card.selected { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.solution-card h3 { font-size: 16px; font-weight: 600; color: #111827; margin: 0 0 10px; }
.solution-card .concept { font-size: 14px; color: #6b7280; line-height: 1.5; margin-bottom: 15px; margin-top: 15px; flex-grow: 1; }
.solution-card .uvp-label { font-size: 12px; font-weight: bold; color: #374151; margin-bottom: 5px; }
.solution-card .uvp-text { font-size: 14px; font-style: italic; color: #4b5563; margin-bottom: 20px; }
.pricing-model-tag { align-self: flex-start; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 500; background-color: #d1fae5; color: #065f46; }

/* --- Tab 6: Validate Your Idea --- */
.summary-box, .action-box { background-color: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 25px; margin-bottom: 30px; }
.summary-box h3, .action-box h3 { margin-top: 0; font-size: 18px; color: #111827; display: flex; align-items: center; gap: 10px; }
#validation-summary-content p { margin: 10px 0 0; font-size: 16px; line-height: 1.6; display: flex; align-items: flex-start; gap: 10px; }
#validation-summary-content .fas { color: #4f46e5; width: 20px; text-align: center; margin-top: 4px; }
.action-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-top: 20px; }
.action-btn { background: #fff; border: 1px solid #d1d5db; color: #374151; padding: 15px 20px; border-radius: 6px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; transition: all 0.2s; }
.action-btn:hover { background-color: #f3f4f6; border-color: #9ca3af; }
.action-btn .fas { color: #4f46e5; }

/* --- Modals --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(17, 24, 39, 0.6); z-index: 1000; display: flex; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(5px); }
.modal-content { background: #fff; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); width: 100%; max-width: 1200px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-content.large { max-width: 1200px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 30px; border-bottom: 1px solid #e5e7eb; }
.modal-header h2 { margin: 0; }
.modal-close { font-size: 28px; font-weight: bold; color: #6b7280; cursor: pointer; }
.modal-body { padding: 30px; overflow-y: auto; }
.modal-body .loading-spinner { min-height: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
#persona-core-profile { display: flex; gap: 30px; margin-bottom: 30px; }
#persona-avatar { width: 120px; height: 120px; border-radius: 50%; background-color: #e0e7ff; color: #4f46e5; display: flex; justify-content: center; align-items: center; font-size: 48px; font-weight: bold; flex-shrink: 0; }
#persona-intro h3 { margin-top: 0; }
#persona-intro p { font-style: italic; color: #4b5563; }
#persona-details { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 30px; }
.persona-section { margin-bottom: 30px; }
.persona-section h4 { font-size: 18px; border-bottom: 2px solid #eef2ff; padding-bottom: 8px; margin-bottom: 15px; color: #111827; }
.persona-section ul { list-style-type: disc; padding-left: 20px; margin: 0; }
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.market-analysis-tags { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.market-analysis-tags span { background-color: #e0e7ff; color: #3730a3; padding: 5px 15px; border-radius: 16px; font-size: 14px; font-weight: 500; }
.market-analysis-tabs { display: flex; border-bottom: 1px solid #d1d5db; margin-bottom: 25px; }
.market-analysis-tab-link { padding: 10px 20px; cursor: pointer; font-weight: 600; color: #6b7280; border-bottom: 3px solid transparent; }
.market-analysis-tab-link.active { color: #4f46e5; border-bottom-color: #4f46e5; }
.market-analysis-tab-content { display: none; }
.market-analysis-tab-content.active { display: block; }
.ma-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.ma-card { background: #f9fafb; padding: 20px; border-radius: 8px; border: 1px solid #e5e7eb; }
.ma-card h5 { margin-top: 0; color: #111827; }
.ma-card ul { list-style-type: none; padding: 0; margin-top: 10px; }
.ma-card ul li { margin-bottom: 5px; }
.tam-sam-som-container { display: flex; flex-direction: column; gap: 20px; margin-top: 25px; }
.tam-sam-som-box { padding: 20px; border-radius: 8px; }
.tam-sam-som-box h4 { margin-top: 0; font-size: 18px; color: #111827; }
.tam-sam-som-box .tss-value { display: block; font-size: 28px; font-weight: bold; color: #374151; margin-top: 5px; margin-bottom: 15px; }
.tam-sam-som-box ul { list-style-type: disc; padding-left: 20px; margin: 0; color: #4b5563; }
.tam-sam-som-box ul li { margin-bottom: 8px; }
.tam-sam-som-box.tam { border: 1px solid #a5b4fc; background-color: #f5f6fe; }
.tam-sam-som-box.sam { border: 1px solid #7dd3fc; background-color: #f2fbff; }
.tam-sam-som-box.som { border: 1px solid #6ee7b7; background-color: #f0fdf4; }
.low-hanging-fruit { background-color: #fef9c3; border: 1px solid #fde68a; padding: 15px; border-radius: 8px; margin-top: 20px; }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    #ideaquest-ai-app {
        padding: 20px;
    }
    .progress-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    .step span {
        display: none; /* Hide text on small screens */
    }
    #path-cards-grid, #problem-cards-grid, #solution-cards-grid {
        grid-template-columns: 1fr; /* Single column layout */
    }
    .form-footer.space-between {
        flex-direction: column;
        gap: 10px;
    }
    .form-footer .nav-btn {
        width: 100%;
    }
    .audience-item .audience-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .audience-details-actions {
        flex-direction: column;
        display: block;
        width: 100%;
    }
    .audience-details-btn {
        width: 100%;
        justify-content: center;
    }
    .modal-content {
        padding: 10px;
    }
    .modal-body {
        padding: 15px;
    }
    #persona-core-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .persona-grid, .ma-grid {
        grid-template-columns: 1fr;
    }
    .market-analysis-tabs {
        flex-wrap: wrap;
    }
    .market-analysis-tab-link {
        flex-grow: 1;
        text-align: center;
    }
    .action-buttons {
        grid-template-columns: 1fr;
    }
}