/* Setup Page Styles */
.setup-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    background: white;
    min-height: 100vh;
}

/* Step 2 Generate Section */
.step-section-generate {
    width: 100%;
    margin-top: 20px;
}

.step-section-generate .setup-content {
    margin-top: 0;
}

/* Navigation Buttons */
.setup-navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.btn-nav {
    flex: 1;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-nav-back {
    background: #f5f5f5;
    color: #333;
}

.btn-nav-back:hover {
    background: #e0e0e0;
}

.btn-nav-continue {
    background: #667eea;
    color: white;
}

.btn-nav-continue:hover {
    background: #5568d3;
}

/* Story Section Styles (matching index.html) */
.story-section {
    margin-bottom: 30px;
}

.story-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.story-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 18px;
}

.story-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.story-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #667eea;
    transition: transform 0.3s ease;
}

.story-collapse-btn svg {
    transition: transform 0.3s ease;
}

.story-body {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.story-description {
    color: #555;
    line-height: 1.6;
}

.story-description .story-desc-p {
    margin: 0 0 0.75em 0;
}

.story-description .story-list-ol,
.story-description .story-list-ul {
    margin: 0.5em 0 0.75em 1.25em;
    padding-left: 1em;
}

.story-description .story-list-ol li,
.story-description .story-list-ul li {
    margin: 0.25em 0;
}

.story-section-multi .story-card-multi {
    margin-bottom: 16px;
}
.story-section-multi .story-card-multi:last-child {
    margin-bottom: 0;
}
.story-summary-inline {
    display: block;
    font-size: 0.95em;
    color: #666;
    margin-top: 2px;
}
.test-case-story-header {
    padding: 10px 12px;
    margin-top: 12px;
    margin-bottom: 4px;
    background: #f1f5f9;
    border-left: 4px solid #667eea;
    font-weight: 600;
    font-size: 14px;
}
.test-case-story-header:first-child {
    margin-top: 0;
}
.test-case-story-id {
    margin-right: 8px;
    color: #1e40af;
}
.test-case-story-summary {
    color: #475569;
    font-weight: 500;
}

/* Responsive Navigation Buttons */
@media (max-width: 768px) {
    .setup-navigation-buttons {
        flex-direction: column;
    }
    
    .btn-nav {
        width: 100%;
    }
}

/* Header Styles (matching index.html) */
.setup-container header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
}

.setup-container header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.setup-container header .subtitle {
    color: #666;
    font-size: 1.1em;
}

.setup-container header .footer-link {
    color: #667eea;
    text-decoration: none;
}

.setup-container header .footer-link:hover {
    text-decoration: underline;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

.progress-step.active .step-circle {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.progress-step.completed .step-circle {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.progress-step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

.progress-line {
    width: 80px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 10px;
    margin-top: -20px;
}

.progress-step.completed + .progress-line {
    background: #10b981;
}

/* Setup Content */
.setup-content {
    margin-bottom: 40px;
}

.setup-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 30px;
    text-align: center;
}

/* Config Cards */
.config-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.config-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.config-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.config-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    flex-shrink: 0;
}

.status-icon {
    background: #d1fae5;
    color: #10b981;
}

.config-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    flex: 1;
    margin: 0;
}

.optional-badge {
    background: #f3f4f6;
    color: #6b7280;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.config-card-body {
    margin-top: 16px;
}

.config-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.config-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    width: 100%;
}

.config-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* Form Group Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6b7280;
}

/* Custom prompt group: force visible when Input Prompt is selected */
#customPromptGroupSetup.custom-prompt-visible {
    display: block !important;
    visibility: visible !important;
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.radio-label:hover {
    color: #667eea;
}

/* Error Message Styles */
.error-message {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-text {
    color: #991b1b;
    font-size: 13px;
    font-weight: 500;
}

.config-input.input-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.config-input.input-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.config-input:focus {
    outline: none;
    border-color: #667eea;
}

.config-input:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.config-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-status {
    display: flex;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.connected {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.refresh-btn {
    margin-left: auto;
}

.config-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
}

.config-sync {
    display: flex;
    align-items: center;
}

.config-project {
    display: flex;
    align-items: center;
}

/* Status Card */
.status-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.status-message {
    margin-bottom: 16px;
}

.status-text {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.status-text.operational {
    color: #10b981;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #374151;
}

.status-item svg {
    flex-shrink: 0;
}

/* Setup Footer */
.setup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.btn-continue {
    background: #667eea;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-continue:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-continue:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.genspark-logo {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .setup-container {
        padding: 20px 16px;
    }

    .progress-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .progress-line {
        width: 40px;
    }

    .setup-title {
        font-size: 24px;
    }

    .config-card {
        padding: 20px;
    }

    .config-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .config-actions {
        justify-content: flex-end;
    }

    .setup-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-continue {
        width: 100%;
        justify-content: center;
    }
}

/* Step 5: Export & Integrations */
.export-summary {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 0.5rem 0;
}
.export-subtitle {
    color: #718096;
    margin: 0 0 2rem 0;
    font-size: 1rem;
}
.export-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
@media (max-width: 768px) {
    .export-cards {
        grid-template-columns: 1fr;
    }
}
.export-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.export-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.export-card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}
.export-icon-download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.export-card-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #1a202c;
}
.export-card-desc {
    color: #4a5568;
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}
.export-card-detail {
    color: #718096;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}
.export-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: #d1fae5;
    color: #065f46;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.btn-export-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: background 0.2s;
}
.btn-export-primary:hover {
    background: #5568d3;
}
.btn-link-manage {
    display: block;
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem 0;
    margin-bottom: 1rem;
    text-decoration: underline;
}
.btn-link-manage:hover {
    color: #5568d3;
}
.testrail-connection-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.testrail-existing-folder {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.testrail-existing-folder select,
.testrail-connection-fields select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}
.testrail-section-tree {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    background: #fafbfc;
    font-size: 14px;
}
.testrail-section-tree .tree-row {
    display: block;
}
.testrail-section-tree .tree-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    gap: 6px;
    min-height: 28px;
}
.testrail-section-tree .tree-item.tree-depth-0 { padding-left: 8px; }
.testrail-section-tree .tree-item.tree-depth-1 { padding-left: 28px; }
.testrail-section-tree .tree-item.tree-depth-2 { padding-left: 48px; }
.testrail-section-tree .tree-item.tree-depth-3 { padding-left: 68px; }
.testrail-section-tree .tree-item.tree-depth-4 { padding-left: 88px; }
.testrail-section-tree .tree-item.tree-depth-5 { padding-left: 108px; }
.testrail-section-tree .tree-item:hover {
    background: #e2e8f0;
}
.testrail-section-tree .tree-item.selected {
    background: #dbeafe;
    color: #1e40af;
}
.testrail-section-tree .tree-chevron {
    width: 18px;
    flex-shrink: 0;
    color: #64748b;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.testrail-section-tree .tree-chevron.expanded {
    transform: rotate(90deg);
}
.testrail-section-tree .tree-chevron-empty {
    visibility: hidden;
}
.testrail-section-tree .tree-folder-icon {
    flex-shrink: 0;
    font-size: 14px;
    opacity: 0.85;
}
.testrail-section-tree .tree-item-name {
    flex: 1;
    min-width: 0;
}
.testrail-section-tree .tree-children {
    margin-left: 12px;
    border-left: 1px solid #cbd5e0;
    padding-left: 6px;
    margin-top: 0;
    display: none;
}
.testrail-section-tree .tree-children.tree-children-expanded {
    display: block;
}
.testrail-selected-path {
    min-height: 1.4em;
}
.testrail-selected-path.testrail-selected-path-active {
    color: #1e40af;
    font-weight: 500;
}
.testrail-connection-fields .form-group {
    margin-bottom: 1rem;
}
.testrail-connection-fields label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}
.testrail-connection-fields input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
}
.btn-export-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
}
.btn-export-option:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
}
.btn-export-option-icon {
    font-size: 0.85rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}
.btn-export-option-text {
    font-weight: 600;
    color: #1a202c;
    font-size: 1rem;
}
.btn-export-option-hint {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* Coverage step: multiple stories – one block per story */
.coverage-story-block {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}
.coverage-story-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.coverage-story-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
}
.coverage-story-id {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}
.coverage-story-summary {
    color: #475569;
    font-size: 0.95rem;
}
.coverage-story-block .coverage-percentage {
    margin-bottom: 1rem;
}
.coverage-story-block .coverage-results {
    margin-top: 0.5rem;
}

