/**
 * Import/Export Webview Styles
 * Minimal custom styles - reuses atomic.css and core.css where possible
 */

/* Container with footer spacing */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 20px 100px 20px;
}

/* Page switching */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Landing page choice cards */
.choice-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 50px;
}

.choice-card {
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 8px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.choice-card:hover {
    border-color: var(--vscode-focusBorder);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.choice-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.6;
}

/* Side-by-side selection grid (replaces tabs). auto-fit + minmax
 * lets the two columns stack into one when the available width
 * can't fit both at ≥280px — handles narrow Hub col 2 / mobile
 * naturally without a media query. */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.selection-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.selection-column h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--vscode-foreground);
}

/* Selection header - compact layout */
.selection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Checkbox tree for item selection */
.checkbox-tree {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--vscode-panel-border);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--vscode-editor-background);
}

.folder-group {
    margin-bottom: 12px;
}

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

.folder-header {
    display: flex;
    align-items: center;
    padding: 4px 0;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--vscode-panel-border);
    margin-bottom: 6px;
}

.folder-items {
    padding-left: 20px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    padding: 3px 0;
    gap: 8px;
    font-size: 13px;
}

/* File upload drop zone */
.drop-zone {
    border: 2px dashed var(--vscode-panel-border);
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--vscode-editor-background);
}

.drop-zone.drag-over {
    border-color: var(--vscode-focusBorder);
    background: var(--vscode-list-hoverBackground);
}

.drop-zone-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.6;
}

/* Section visibility toggles */
.upload-section,
.conflicts-section {
    display: none;
}

.upload-section.active,
.conflicts-section.active {
    display: block;
}

/* Import summary grid */
.import-summary {
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-value {
    font-weight: 600;
}

/* Conflict detection and resolution */
.conflicts-list {
    margin-bottom: 25px;
}

.conflict-count {
    display: inline-block;
    background: var(--vscode-badge-background);
    color: var(--vscode-badge-foreground);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 8px;
}

#conflictItems {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.conflict-item {
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 6px;
    padding: 15px;
}

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

.conflict-type {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.conflict-type.endpoint {
    background: var(--vscode-charts-blue);
    color: white;
}

.conflict-type.environment {
    background: var(--vscode-charts-green);
    color: white;
}

.conflict-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* No conflicts success message */
.no-conflicts {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.no-conflicts.active {
    display: block;
}

.success-icon {
    font-size: 60px;
    color: var(--vscode-testing-iconPassed);
    margin-bottom: 15px;
}

/* Toast notifications */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.status-message.active {
    opacity: 1;
    transform: translateY(0);
}

.status-message.info {
    background: var(--vscode-notificationsInfoIcon-foreground);
    color: white;
}

.status-message.success {
    background: var(--vscode-testing-iconPassed);
    color: white;
}

.status-message.error {
    background: var(--vscode-notificationsErrorIcon-foreground);
    color: white;
}

/* Checkbox group styling */
.checkbox-group {
    padding: 15px;
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 6px;
}

/* Import items list */
.import-items-list {
    margin-bottom: 25px;
}

.selection-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.import-item {
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 6px;
    padding: 12px 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.import-item-checkbox {
    margin-top: 2px;
}

.import-item-content {
    flex: 1;
    min-width: 0;
}

.import-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.import-item-name {
    font-weight: 600;
    font-size: 14px;
}

.import-item-folder {
    font-size: 11px;
    color: var(--vscode-descriptionForeground);
    background: var(--vscode-badge-background);
    padding: 2px 6px;
    border-radius: 3px;
}

.import-item-action {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.import-item-action.create {
    background: var(--vscode-charts-green);
    color: white;
}

.import-item-action.update {
    background: var(--vscode-charts-blue);
    color: white;
}

.import-item-action.conflict {
    background: var(--vscode-charts-yellow);
    color: black;
}

.import-item-action.resolved {
    background: var(--vscode-testing-iconPassed);
    color: white;
}

.import-item-conflict-resolution {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.import-item-conflict-resolution select {
    width: 150px;
}

.import-item-conflict-resolution input {
    flex: 1;
}

/* Endpoint renamed at import because its name was already taken */
.import-item-renamed {
    font-size: 11px;
    font-style: italic;
    color: var(--vscode-descriptionForeground);
}

/* Partial import — items that failed, under the import summary */
.import-failures {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--vscode-panel-border);
}

.import-failures h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--vscode-errorForeground);
}

.import-failures ul {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
}

/* Success Page */
.success-content {
    margin-top: 30px;
}

.success-summary {
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.success-summary h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--vscode-foreground);
}

.success-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--vscode-panel-border);
}

.success-summary-row:last-child {
    border-bottom: none;
}

.success-summary-label {
    color: var(--vscode-descriptionForeground);
    font-size: 13px;
}

.success-summary-value {
    font-weight: 600;
    font-size: 13px;
}

.success-details {
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 6px;
    padding: 15px;
}

.success-details h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
}

.success-details p {
    margin: 5px 0;
    font-size: 12px;
    color: var(--vscode-descriptionForeground);
}

.success-details code {
    background: var(--vscode-textCodeBlock-background);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* Postman import options panel (issue #189) */
.postman-options-panel {
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 18px;
}

.postman-options-panel.hidden {
    display: none;
}

.postman-options-panel h3 {
    margin: 0 0 6px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.postman-options-panel .help-icon {
    cursor: pointer;
    color: var(--vscode-descriptionForeground);
    display: inline-flex;
    align-items: center;
}

.postman-options-panel .help-icon:hover {
    color: var(--vscode-textLink-foreground);
}

.postman-help-link {
    color: var(--vscode-textLink-foreground);
    text-decoration: underline;
    cursor: pointer;
}

.postman-options-summary {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: var(--vscode-descriptionForeground);
}

.postman-option-row {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.postman-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.postman-option-hint {
    color: var(--vscode-descriptionForeground);
    font-size: 11px;
    margin-left: 4px;
}

.postman-folder-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 4px;
}

.postman-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.postman-target-folder-input {
    border: 1px solid var(--vscode-input-border);
    background: var(--vscode-input-background);
    color: var(--vscode-input-foreground);
    padding: 3px 8px;
    font-size: 12px;
    min-width: 220px;
}

.postman-target-folder-input:disabled {
    opacity: 0.5;
}

/* Contextual unsupported-features warning (issue #189) */
/* High-contrast: text always uses --vscode-foreground; the amber accent is */
/* a left bar + icon, not a tinted background — so the panel reads cleanly */
/* in any theme regardless of inputValidation-warningBackground/Foreground. */
.postman-unsupported {
    background: var(--vscode-editorWidget-background, var(--vscode-editor-background));
    border: 1px solid var(--vscode-panel-border);
    border-left: 4px solid var(--vscode-editorWarning-foreground, #f59e0b);
    border-radius: 4px;
    padding: 12px 14px;
    margin: 0 0 14px 0;
    color: var(--vscode-foreground);
}

.postman-unsupported.hidden {
    display: none;
}

.postman-unsupported-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--vscode-foreground);
}

.postman-unsupported-icon {
    font-size: 14px;
    color: var(--vscode-editorWarning-foreground, #f59e0b);
}

.postman-unsupported-title {
    color: var(--vscode-foreground);
}

.postman-unsupported-list {
    margin: 0 0 4px 24px;
    padding: 0;
    font-size: 12.5px;
    color: var(--vscode-foreground);
    line-height: 1.5;
}

.postman-unsupported-item {
    margin: 2px 0;
}

.postman-unsupported-item-label {
    color: var(--vscode-foreground);
}

.postman-unsupported-item-detail {
    color: var(--vscode-descriptionForeground);
    font-size: 11.5px;
}

.postman-unsupported-help {
    margin: 6px 0 0 24px;
    font-size: 12px;
    color: var(--vscode-descriptionForeground);
}

.postman-unsupported-help .postman-help-link {
    color: var(--vscode-textLink-foreground);
    text-decoration: underline;
}

/* Per-endpoint data-loss flag chip (issue #189) */
.postman-loss-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border: 1px solid var(--vscode-editorWarning-foreground, #f59e0b);
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--vscode-foreground);
    background: transparent;
    cursor: help;
    white-space: nowrap;
}

.postman-loss-chip:hover {
    background: var(--vscode-list-hoverBackground);
}

.postman-loss-chip-icon {
    color: var(--vscode-editorWarning-foreground, #f59e0b);
    font-size: 12px;
    line-height: 1;
}
