/* API Client Modal - Xbox 360 Blade UI Design */

.api-client-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.api-client-modal-overlay.visible {
    opacity: 1;
}

.api-client-modal {
    width: 92%;
    height: 88%;
    max-width: 1400px;
    max-height: 900px;
    background: var(--bg-primary);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) rotateX(5deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.api-client-modal-overlay.visible .api-client-modal {
    transform: scale(1) rotateX(0);
}

/* Modal Header */
.api-client-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 16px 16px 0 0;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-icon {
    font-size: 11px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.editing-badge {
    background: var(--info);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-action-btn.primary {
    background: var(--info);
    color: white;
    border: none;
}

.modal-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-action-btn.primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 16px var(--shadow-hover);
}

.modal-action-btn.btn-success-flash {
    animation: successFlash 1s ease;
}

@keyframes successFlash {
    0%, 100% {
        background: var(--info);
    }
    50% {
        background: var(--success);
        transform: scale(1.05);
    }
}

.modal-close-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
    transform: rotate(90deg);
}

/* Modal Body */
.api-client-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

/* Blade Container */
.blade-container {
    display: flex;
    height: 100%;
    position: relative;
}

/* Blade Navigation */
.blade-nav {
    width: 180px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-right: 1px solid var(--border-color);
}

.blade-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.blade-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--info);
    transform: translateX(-4px);
    transition: transform 0.3s ease;
}

.blade-tab:hover {
    background: var(--bg-tertiary);
    padding-left: 20px;
}

.blade-tab.active {
    background: var(--bg-tertiary);
    padding-left: 22px;
}

.blade-tab.active::before {
    transform: translateX(0);
}

.blade-tab.transitioning {
    animation: bladePulse 0.3s ease;
}

@keyframes bladePulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

.blade-icon {
    font-size: 11px;
    filter: grayscale(50%);
    transition: filter 0.3s ease;
}

.blade-tab.active .blade-icon {
    filter: grayscale(0%) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.blade-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.blade-tab.active .blade-label {
    color: var(--text-primary);
}

.blade-count {
    margin-left: auto;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Blade Content */
.blade-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.blade-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    transform: translateX(100px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.blade-panel.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: all;
    padding: 0;
}

.blade-panel.transitioning {
    transition: all 0.15s ease-out;
}

/* Request Form */
.request-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
}

/* Request Section (matching Response Section) */
.request-section {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.request-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.request-section-header h3 {
    margin: 0;
    font-size: 11px;
    color: var(--text-primary);
}

.request-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.request-header {
    background: var(--bg-secondary);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.request-name-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    transition: border-color 0.2s;
}

.request-name-input:focus {
    outline: none;
    border-color: var(--info);
}

.request-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.request-header-actions .btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

/* Button styles replaced - using .btn-primary and .btn-secondary from buttons.css */
.request-header-actions .btn:hover {
    /* Specific hover behavior can stay if needed */
    border-color: var(--info);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.request-header-actions .action-icon {
    font-size: 12px;
}

.request-method-url {
    display: flex;
    gap: 10px;
    width: 100%;
}

.method-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.method-select:hover {
    border-color: var(--info);
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 11px;
    transition: border-color 0.2s;
}

.url-input:focus {
    outline: none;
    border-color: var(--info);
}

/* Send button styles moved to components/buttons.css */

/* Request Tabs */
.request-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: transparent;
    padding: 0 12px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
}

.tab-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: var(--bg-secondary);
}

.tab-panel {
    display: none;
    height: 100%;
    flex-direction: column;
}

.tab-panel.active {
    display: flex;
}

/* Response Section */
.response-section {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: 300px;
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.response-header h3 {
    margin: 0;
    font-size: 11px;
    color: var(--text-primary);
}

.response-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.response-status.success {
    background: var(--bg-tertiary);
    color: var(--success);
}

.response-status.error {
    background: var(--bg-tertiary);
    color: var(--error);
}

.response-content {
    flex: 1;
    overflow: auto;
    padding: 12px;
    outline: none;  /* Remove focus outline */
}

.response-content:focus {
    background: var(--bg-primary);  /* Keep same background when focused */
}

.empty-response {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
    font-size: 12px;
}

.response-body, .error-content {
    margin: 0;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Blade Sections - Unified Styling */
.library-section, .history-section, .collections-section, .environment-section, .authentication-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.library-section-header, .history-section-header, .collections-section-header, .environment-section-header, .authentication-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.library-section-header h3, .history-section-header h3, .collections-section-header h3, .environment-section-header h3 {
    margin: 0;
    font-size: 11px;
    color: var(--text-primary);
}

.library-content, .history-content, .collections-content, .environment-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.library-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.library-search {
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 11px;
}

.library-list, .history-list, .collections-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 8px;
}

/* Library Items */
.library-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: move;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.library-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px var(--shadow);
}

.library-item[draggable="true"] {
    cursor: grab;
}

.library-item[draggable="true"]:active {
    cursor: grabbing;
}

.request-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0; /* Allow shrinking */
    overflow: hidden;
}

.request-method {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.method-get { background: var(--bg-tertiary); color: var(--success); }
.method-post { background: var(--bg-tertiary); color: var(--info); }
.method-put { background: var(--bg-tertiary); color: var(--warning); }
.method-patch { background: var(--bg-tertiary); color: var(--text-primary); }
.method-delete { background: var(--bg-tertiary); color: var(--error); }

.request-name {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* Allow shrinking */
    color: var(--text-primary);
}

.library-item .request-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}


.btn-icon-small {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: var(--bg-tertiary);
}

/* Folders */
.library-folder {
    margin-bottom: 12px;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Removed - now handled by .expanded class */

.folder-toggle {
    margin-right: 5px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-weight: bold;
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.folder-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.folder-toggle:active {
    transform: scale(0.95);
}

/* Default state - expanded (arrow pointing down) */
.library-folder .folder-toggle {
    transform: rotate(0deg);
}

/* Collapsed state (arrow pointing right) */
.library-folder:not(.expanded) .folder-toggle {
    transform: rotate(-90deg);
}

.library-folder.drag-over {
    border-color: var(--info);
    background: var(--bg-tertiary);
    transform: scale(1.005); /* Very subtle scale to prevent cutoff */
}

.folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.folder-header:hover {
    background: var(--bg-primary);
}

.folder-header-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 100px; /* Ensure minimum space for folder name */
    overflow: hidden;
}

.folder-icon {
    font-size: 11px;
    flex-shrink: 0;
    /* Removed transition - folder icon should not animate */
}

/* Removed - folder icon should not rotate */

.folder-name {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* Allow shrinking */
}

.folder-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.folder-count {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
}

.folder-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}

.folder-actions .btn-icon-small {
    opacity: 0;
    transition: opacity 0.2s;
}

.folder-header:hover .folder-actions .btn-icon-small {
    opacity: 1;
}

/* Default state - folders collapsed */
.folder-contents {
    display: none;
    padding-left: 16px;
    padding-top: 8px;
}

/* Expanded state - show DIRECT child contents only */
.library-folder.expanded > .folder-contents {
    display: block;
}

/* Nested folders should respect their own expanded state */
.library-folder .library-folder .folder-contents {
    display: none;
}

.library-folder .library-folder.expanded > .folder-contents {
    display: block;
}

.empty-folder {
    padding: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    margin: 6px 0;
}

.folder-rename-input {
    background: var(--bg-primary);
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-block;
    outline: none;
    min-width: 100px;
}

/* History Items */
.history-item {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.history-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.history-request {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-url {
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Body Editor */
.body-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.body-textarea {
    width: 100%;
    flex: 1;
    min-height: 200px;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 11px;
    resize: vertical;
    outline: none;
}

.body-textarea:focus {
    border-color: var(--info);
}

/* Form Elements */
.headers-list, .variables-list {
    margin-bottom: 12px;
}

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

/* Authentication Status Dot */
.header-value-wrapper {
    position: relative;
    flex: 1;
    display: flex;
}

.header-value-wrapper .header-value {
    padding-right: 24px; /* Make room for the dot */
}

.auth-status-dot {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    z-index: 1;
}

.auth-status-authenticated {
    color: #4CAF50;
}

.auth-status-missing {
    color: #ff6b6b;
    animation: subtle-pulse 2s ease-in-out;
}

.auth-status-missing:hover {
    transform: translateY(-50%) scale(1.2);
    filter: brightness(1.2);
}

@keyframes subtle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.header-key, .header-value, .var-name, .var-path {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
}

.btn-remove {
    width: 24px;
    height: 24px;
    background: var(--bg-tertiary);
    color: var(--error);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: var(--error);
    color: white;
}

.btn-add {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-add:hover {
    background: var(--bg-primary);
    transform: translateY(-1px);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 11px;
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-primary);
}

/* Empty States */
.empty-state, .loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 11px;
}

/* Environment Variables */
#saveEnvironment.unsaved {
    color: #ff6b6b;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Environment Variables */

.environment-actions {
    display: flex;
    gap: 4px;
}

.environment-info {
    background: var(--bg-tertiary);
    padding: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.info-text {
    margin: 0;
    font-size: 11px;
    color: var(--text-secondary);
}

.environment-variables {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
}

/* Environment variable header */
.env-variable-header {
    display: grid;
    grid-template-columns: 150px 1fr 60px 30px;
    gap: 4px;
    padding: 6px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.env-header-key {
    padding-left: 5px;
}

.env-header-value {
    padding-left: 5px;
}

.env-header-persist {
    text-align: center;
}

.env-header-actions {
    /* Empty for alignment */
}

.env-variable-row {
    display: grid;
    grid-template-columns: 150px 1fr 60px 30px;
    gap: 4px;
    margin-bottom: 4px;
    align-items: center;
}

/* Environment variable inputs now use .form-input-sm from forms.css */

/* Persist toggle switch */
.env-persist-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
    margin: 0 auto;
}

.env-persist-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.persist-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 18px;
}

.persist-toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.env-persist-checkbox:checked + .persist-toggle-slider {
    background-color: var(--success);
}

.env-persist-checkbox:checked + .persist-toggle-slider:before {
    transform: translateX(18px);
}

.env-value.recently-updated {
    animation: valueUpdated 2s ease;
    border-color: var(--success) !important;
}

@keyframes valueUpdated {
    0% {
        background-color: rgba(76, 175, 80, 0.2);
        border-color: var(--success);
        transform: scale(1.02);
    }
    50% {
        background-color: rgba(76, 175, 80, 0.1);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}


/* Edit button on cards */
.workflow-card .card-edit-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    z-index: 10;
}

.workflow-card.api .card-edit-btn {
    display: flex;
    opacity: 0;
}

.workflow-card:hover .card-edit-btn {
    opacity: 1;
}

.workflow-card .card-edit-btn:hover {
    background: var(--info);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .blade-nav {
        width: 160px;
    }
    
    .blade-label {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .api-client-modal {
        width: 95%;
        height: 95%;
    }
    
    .blade-nav {
        width: 120px;
    }
    
    .blade-tab {
        padding: 12px 16px;
    }
    
    .blade-icon {
        font-size: 11px;
    }
    
    .modal-action-btn span:not(.action-icon) {
        display: none;
    }
}

/* Dark Theme Adjustments */
[data-theme="dark"] .api-client-modal {
    background: #1a1a1a;
}

[data-theme="dark"] .blade-nav {
    background: var(--bg-secondary);
}

/* Library Collection Display */
.library-collection {
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.library-collection .collection-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.library-collection .collection-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.library-collection .collection-count {
    margin-right: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.library-collection .collection-badge {
    background: var(--info);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    text-transform: uppercase;
}

.library-collection .collection-badge.user-badge {
    background: var(--success);
}

.library-collection .collection-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.library-collection .collection-contents {
    padding: 8px;
    background: var(--bg-secondary);
}

.library-collection.collapsed .collection-contents {
    display: none;
}

.library-collection.expanded .collection-contents {
    display: block;
}

/* Library separator between user APIs and collections */
.library-separator {
    margin: 16px 0;
    height: 1px;
    background: var(--border-color);
    position: relative;
}

.library-separator::after {
    content: "Imported Collections";
    position: absolute;
    top: -8px;
    left: 10px;
    background: var(--bg-secondary);
    padding: 0 8px;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.library-collection .library-item.collection-item {
    background: var(--bg-primary);
    opacity: 0.95;
}

.library-section {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.library-section .section-header {
    display: flex;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 8px;
}

.library-section .section-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.library-section .section-count {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Collections View Styles */
#collectionsList {
    width: 100%;
    padding: 8px;
}

.collection-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.collection-item:hover {
    border-color: var(--info);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collection-header {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.collection-info {
    flex: 1;
    min-width: 0;
}

.collection-name {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.api-count {
    font-weight: 500;
}

.import-date {
    opacity: 0.8;
}

.collection-actions {
    display: flex;
    gap: 8px;
}

.delete-collection {
    white-space: nowrap;
}

/* Empty and Error States for Collections */
#collectionsList .empty-state, 
#collectionsList .error-state {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 12px;
}

#collectionsList .error-state {
    color: var(--error);
}



/* Authentication blade specific styles */
.authentication-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.auth-configs-list {
    margin-bottom: 20px;
}

.auth-config-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.auth-config-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.auth-config-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.auth-config-details {
    margin: 12px 0;
}

.auth-config-field {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 13px;
}

.auth-config-field label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 8px;
    min-width: 80px;
}

.auth-config-field span {
    color: var(--text-primary);
}

/* Auth Configuration Selector */
.auth-selector-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 16px;
}

.auth-selector-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-config-selector {
    flex: 1;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}

.auth-config-selector:focus {
    outline: none;
    border-color: var(--info);
}

/* Auth Status Bar */
.auth-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 12px;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-right: 8px;
}

.auth-config-status[data-authenticated="true"] .status-indicator {
    background: var(--success);
}

/* Auth Form Sections */
.auth-form-section {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 12px;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Token Display Container */
.token-display-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.auth-expiry {
    color: var(--text-primary);
    font-size: 12px;
}

/* Styling for select dropdowns in auth config */
.auth-select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-select:hover {
    border-color: var(--primary-color);
}

.auth-select:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Styling for text inputs in auth config */
.auth-input {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    width: 150px;
    transition: all 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.auth-token-display {
    font-family: monospace;
    font-size: 11px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-config-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.auth-config-actions .btn {
    flex: 1;
}

.auth-config-info,
.auth-status-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-token-preview {
    font-family: monospace;
    font-size: 11px;
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-actions {
    display: flex;
    gap: 8px;
}

/* Authentication Configuration Form */
.auth-config-form {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 16px;
}

.auth-config-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.auth-config-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-config-fields .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-config-fields .form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-config-fields .form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.2s;
}

.auth-config-fields .form-control:focus {
    outline: none;
    border-color: var(--info);
}

.auth-config-fields .form-control::placeholder {
    color: var(--text-muted);
}

.auth-config-form .form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Auth Configuration Modal */
.auth-config-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.auth-config-modal {
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.auth-config-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.auth-config-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-config-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.auth-config-modal-body .form-group {
    margin-bottom: 16px;
}

.auth-config-modal-body .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-config-modal-body .form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.auth-config-modal-body .form-control:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.auth-config-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.auth-config-form .form-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

.auth-config-form .form-actions .btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.auth-config-form .form-actions .btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* ==============================================
   CLEAN COMPACT LIBRARY DESIGN
   Apply the same clean folder structure from Load modal
   ============================================== */

/* Toggle for compact view mode */
.library-toggle-compact {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

/* Enhanced Library Folder Structure */
.library-list.compact-view .library-folder {
    margin-bottom: 3px;
    border: 2px solid transparent;
    width: 100%;
    transition: all 0.2s ease;
}

.library-list.compact-view .folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100%;
}

/* Wrapper for folder content with indentation */
.library-list.compact-view .folder-header-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

/* Content indentation based on nesting level */
.library-list.compact-view .library-folder[data-level="1"] .folder-header-wrapper,
.library-list.compact-view .library-folder[style*="margin-left: 20px"] .folder-header-wrapper {
    padding-left: 20px;
}

.library-list.compact-view .library-folder[data-level="2"] .folder-header-wrapper,
.library-list.compact-view .library-folder[style*="margin-left: 40px"] .folder-header-wrapper {
    padding-left: 40px;
}

/* Remove margin-based indentation, use full width */
.library-list.compact-view .library-folder[style*="margin-left"] {
    margin-left: 0 !important;
}

/* Library items with full width and content indentation */
.library-list.compact-view .library-item {
    display: flex;
    width: 100%;
    margin: 2px 0;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    transition: all 0.2s;
}

/* Item content indentation based on parent folder level */
.library-list.compact-view .folder-contents > .library-item {
    padding-left: 30px;
}

.library-list.compact-view .library-folder[style*="margin-left: 20px"] .library-item {
    padding-left: 50px;
}

.library-list.compact-view .library-folder[style*="margin-left: 40px"] .library-item {
    padding-left: 70px;
}

/* Request info styling */
.library-list.compact-view .request-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.library-list.compact-view .request-method {
    font-size: 10px;
    padding: 2px 6px;
    min-width: 45px;
    text-align: center;
    border-radius: 3px;
    font-weight: 600;
    flex-shrink: 0;
}

.library-list.compact-view .request-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Folder count badges */
.library-list.compact-view .folder-count {
    background-color: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

/* Collection header enhancement */
.library-list.compact-view .collection-header {
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 4px;
}

/* Smooth transitions */
.library-list.compact-view .folder-contents {
    padding: 0;
}

/* Clean hover effects */
.library-list.compact-view .library-item:hover {
    transform: none;
    background: var(--bg-tertiary);
    border-color: var(--info);
}

.library-list.compact-view .folder-header:hover {
    background: var(--bg-tertiary);
    border-color: var(--info);
}

/* Drag and drop highlighting */
.library-list.compact-view .library-folder.drag-over {
    border: 2px solid var(--info);
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
    transform: none; /* No scaling to prevent cutoff */
}

.library-list.compact-view .library-folder.drag-over .folder-header {
    background: rgba(52, 152, 219, 0.15);
    border-color: var(--info);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
    transform: none; /* No scaling */
}

.library-list.compact-view .collection-contents.drag-over {
    background: rgba(52, 152, 219, 0.1);
    border: 2px dashed var(--info);
    border-radius: 4px;
    padding: 4px;
    margin: 4px 0;
}

/* Hide action buttons in compact view for cleaner look */
.library-list.compact-view .folder-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.library-list.compact-view .folder-header:hover .folder-actions {
    opacity: 1;
}

.library-list.compact-view .request-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.library-list.compact-view .library-item:hover .request-actions {
    opacity: 1;
}
