/* AdminUpdateCreateDialog Styles */

/* Custom Header Styles */
.admin-update-create-dialog .dialog-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 8px;
}

.admin-update-create-dialog .dialog-header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.admin-update-create-dialog .dialog-header-buttons {
    display: flex;
    gap: 4px;
}

.admin-update-create-dialog .dialog-header-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.admin-update-create-dialog .dialog-header-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.admin-update-create-dialog .dialog-header-btn .material-symbols-outlined {
    font-size: 20px;
    color: #d0d0d0;
}

.admin-update-create-dialog .dialog-header-btn:hover .material-symbols-outlined {
    color: #fff;
}

/* Stepper wrapper to contain properly */
.admin-update-create-dialog .stepper-wrapper {
    padding: 0 40px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* Stepper text color */
.admin-update-create-dialog .e-stepper .e-step-label-container .e-step-label,
.admin-update-create-dialog .e-stepper .e-step-label-container .e-step-text {
    color: #000 !important;
}

/* Dialog content layout - fixed height with flex */
.admin-update-create-dialog .e-dlg-content {
    display: flex;
    flex-direction: column;
    overflow: visible;
    flex: 1;
    min-height: 0;
}

.admin-update-create-dialog .step-content-container {
    flex: 1;
    padding: 8px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* When showing placeholder (no JSON loaded), don't expand the content containers */
.admin-update-create-dialog .step-content-container:has(.json-placeholder-container) {
    flex: 0 0 auto;
}

.admin-update-create-dialog .e-dlg-content:has(.json-placeholder-container) {
    flex: 0 0 auto;
}

/* Auto-size dialog height when no JSON file loaded */
.admin-update-create-dialog:has(.json-placeholder-container) {
    height: auto !important;
    max-height: 90vh;
}

/* Ensure dialog container covers full viewport and centers dialog when auto-height */
.e-dlg-container.admin-update-create-dialog:has(.json-placeholder-container) {
    height: 100vh !important;
    width: 100vw !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* The actual dialog element inside the container */
.e-dlg-container.admin-update-create-dialog:has(.json-placeholder-container) > .e-dialog {
    height: auto !important;
    max-height: 90vh;
}

/* Ensure overlay covers full viewport */
.e-dlg-container.admin-update-create-dialog .e-dlg-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.admin-update-create-dialog .step-content-container > .row {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

/* When JSON placeholder is shown (no file loaded), don't expand the row */
.admin-update-create-dialog .step1-row:has(.json-placeholder-container) {
    flex: 0 0 auto;
}

/* When placeholder is shown, left column should not have excessive height */
.admin-update-create-dialog .step1-row:has(.json-placeholder-container) > .col-md-5 {
    flex: 0 0 auto;
}

/* Step 1 row alignment - default to flex-start, switch to stretch when JSON loaded */
.admin-update-create-dialog .step1-row {
    display: flex;
    align-items: flex-start;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

/* When JSON IS loaded (no placeholder), stretch to fill height and clip overflow */
.admin-update-create-dialog .step1-row:not(:has(.json-placeholder-container)) {
    align-items: stretch;
    overflow: hidden;
}

/* JSON Preview compact styling */
.admin-update-create-dialog .json-preview-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.admin-update-create-dialog .json-preview-container {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    position: relative;
}

/* Override the JsonViewer's fixed height when inside this dialog */
.admin-update-create-dialog .json-preview-container .json-display {
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.admin-update-create-dialog .json-preview-container .json-tree {
    overflow: auto !important;
    flex: 1 !important;
    min-height: 0 !important;
    padding: 8px;
}

/* JSON Placeholder Styles */
.admin-update-create-dialog .json-placeholder-container {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make the columns flex properly - preserve Bootstrap widths but constrain height */
.admin-update-create-dialog .step1-row > .col-md-5 {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
    margin-bottom: 10px;
}

.admin-update-create-dialog .step1-row > .col-md-7 {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    align-self: stretch;
    overflow: hidden;
    margin-bottom: 10px;
}

.admin-update-create-dialog .json-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.admin-update-create-dialog .json-placeholder-icon {
    font-size: 240px;
    color: #e0e0e0;
    line-height: 1;
}

.admin-update-create-dialog .json-placeholder-text {
    color: #e0e0e0;
    margin-top: 0.5rem;
}

.admin-update-create-dialog .json-placeholder-text p {
    margin: 0;
}

.admin-update-create-dialog .json-placeholder-text .fw-bold {
    font-size: 0.95rem;
}

.admin-update-create-dialog .json-preview-container .json-controls {
    display: none !important;
}

/* File upload zone */
.admin-update-create-dialog .file-upload-zone {
    min-height: 60px;
}

/* Selected counter styling */
.admin-update-create-dialog .selected-counter {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

/* Workspace Tree Styles */
.admin-update-create-dialog .workspace-tree-container {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
}

.admin-update-create-dialog .affiliate-node {
    border-bottom: 1px solid #eee;
}

.admin-update-create-dialog .affiliate-node:last-child {
    border-bottom: none;
}

.admin-update-create-dialog .affiliate-header {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    gap: 8px;
}

.admin-update-create-dialog .affiliate-header:hover {
    background-color: #f8f9fa;
}

.admin-update-create-dialog .affiliate-name {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.admin-update-create-dialog .affiliate-name .badge-sm {
    font-size: 0.7rem;
    padding: 2px 6px;
    margin-left: 4px;
}

.admin-update-create-dialog .expand-icon {
    color: #6c757d;
    margin-left: 4px;
    font-size: 1.1rem;
}

.admin-update-create-dialog .workspace-children {
    padding-left: 28px;
    background: #fafafa;
}

.admin-update-create-dialog .workspace-item {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    gap: 8px;
    font-size: 0.85rem;
}

.admin-update-create-dialog .workspace-item:hover {
    background-color: #f0f0f0;
}

.admin-update-create-dialog .workspace-name {
    flex: 1;
}

.admin-update-create-dialog .workspace-datasource {
    width: 33%;
    text-align: left;
    flex-shrink: 0;
}

/* Step 3: Review & Apply Card */
.admin-update-create-dialog .review-apply-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.admin-update-create-dialog .review-apply-card .card-body {
    padding: 1rem;
}

.admin-update-create-dialog .review-summary {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.75rem;
}

.admin-update-create-dialog .summary-item {
    display: flex;
    flex-direction: column;
}

.admin-update-create-dialog .summary-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.admin-update-create-dialog .summary-value {
    font-size: 0.95rem;
    font-weight: 500;
    word-break: break-word;
}

.admin-update-create-dialog .workspaces-section .section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--foo-blue2, #0b3b60);
    margin-bottom: 0.5rem;
}

.admin-update-create-dialog .selected-workspaces-scroll {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.75rem;
    background: #fafafa;
}

.admin-update-create-dialog .workspace-group {
    margin-bottom: 0.75rem;
}

.admin-update-create-dialog .workspace-group:last-child {
    margin-bottom: 0;
}

.admin-update-create-dialog .group-name {
    font-size: 0.9rem;
    color: var(--foo-blue2, #0b3b60);
}

.admin-update-create-dialog .workspace-list {
    font-size: 0.9rem;
    color: #495057;
    list-style-type: disc;
}

.admin-update-create-dialog .workspace-list li {
    padding: 2px 0;
}

/* Apply Confirmation Card */
.admin-update-create-dialog .apply-confirmation-card {
    text-align: center;
    padding: 2rem 1rem;
}

.admin-update-create-dialog .confirmation-icon {
    margin-bottom: 1rem;
}

.admin-update-create-dialog .confirmation-icon .material-symbols-outlined {
    font-size: 64px;
    color: #ffc107;
}

.admin-update-create-dialog .confirmation-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foo-blue2, #0b3b60);
    margin-bottom: 0.75rem;
}

.admin-update-create-dialog .confirmation-message {
    font-size: 1rem;
    color: #212529;
    margin-bottom: 0.5rem;
}

.admin-update-create-dialog .confirmation-details {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.admin-update-create-dialog .confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.admin-update-create-dialog .confirmation-actions .btn {
    min-width: 120px;
}
