/**
 * Workspace Settings Dialog Styles
 * This file contains only workspace-settings-dialog specific styles.
 * All modal, form, button, and other shared styles are imported from main.css
 */

/* Larger modal for settings dialog */
.workspace-settings-dialog {
    max-width: 800px;
}

/* Custom header (not using default modal-header) */
.workspace-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.workspace-settings-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Content wrapper with sidebar and content area */
.workspace-settings-content-wrapper {
    display: flex;
    min-height: 480px;
    height: 480px;
    overflow: hidden;
}

/* Vertical sidebar navigation */
.workspace-settings-nav {
    width: 200px;
    flex-shrink: 0;
    padding: 20px 0;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.workspace-settings-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.workspace-settings-nav-item:hover {
    background-color: rgba(128, 128, 128, 0.3);
    color: var(--text);
}

.workspace-settings-nav-item.active {
    color: var(--text);
    border-left-color: var(--accent);
    background-color: rgba(16, 185, 129, 0.15);
}

.workspace-settings-nav-item.active:hover {
    background-color: rgba(16, 185, 129, 0.2);
}

.workspace-settings-nav-item.danger {
    color: var(--danger);
}

.workspace-settings-nav-item.danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.workspace-settings-nav-item.danger.active {
    border-left-color: var(--danger);
}

.workspace-settings-nav-divider {
    height: 1px;
    margin: 8px 20px;
    background-color: var(--border);
}

.workspace-settings-nav-item img,
.workspace-settings-nav-item svg {
    flex-shrink: 0;
}

/* Tab content area */
.workspace-settings-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.workspace-settings-tab-content {
    display: none;
}

.workspace-settings-tab-content.active {
    display: block;
}

/* Settings sections */
.settings-section {
    max-width: 500px;
}

.settings-section h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
}

.danger-description {
    margin: 0 0 16px 0;
    color: var(--muted);
    line-height: 1.5;
}

.danger-section {
    border: 1px solid var(--danger);
    border-radius: 12px;
    padding: 20px;
    background-color: rgba(239, 68, 68, 0.05);
}

/* Read-only value display */
.read-only-value {
    padding: 10px 12px;
    background-color: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
}

/* Input with suffix (e.g., "30 days") */
.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
    width: 150px;
}

.input-with-suffix .input {
    padding-right: 50px;
}

.input-suffix {
    position: absolute;
    right: 12px;
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
}

/* Info box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.info-box img,
.info-box svg {
    flex-shrink: 0;
    color: var(--accent);
    margin-top: 2px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    background-color: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

/* Special styling for Last Document Received to show date + relative time */
[data-stat-last-document] {
    font-size: 16px !important;
    line-height: 1.4;
}

/* Footer */
.workspace-settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* Close button */
.btn-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, color 0.15s;
}

.btn-close:hover {
    background-color: var(--bg-elev);
    color: var(--text);
}

/* IP Whitelist tab */
.whitelist-description {
    margin: 0 0 16px 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.whitelist-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.whitelist-toggle-label input[type='checkbox'] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.whitelist-textarea {
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    resize: vertical;
    min-height: 100px;
    width: 100%;
}

[data-whitelist-entries-field] {
    margin-top: 12px;
}

[data-whitelist-entries-field].hidden {
    display: none;
}

/* Recent connections */
.whitelist-connections {
    margin-top: 20px;
}

.whitelist-connections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.connections-time-select {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-elev);
    color: var(--text);
    cursor: pointer;
    width: auto;
    flex-shrink: 0;
}

.whitelist-connections-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
}

.whitelist-connections-empty {
    padding: 12px 16px;
    color: var(--muted);
    font-size: 13px;
}

.whitelist-connection-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.whitelist-connection-row:last-child {
    border-bottom: none;
}

.whitelist-connection-ip {
    font-family: var(--font-mono, monospace);
    flex: 1;
    color: var(--text);
}

.whitelist-connection-time {
    color: var(--muted);
    white-space: nowrap;
}

.whitelist-connection-status {
    font-weight: 600;
    white-space: nowrap;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.whitelist-connection-status.allowed {
    color: var(--accent);
    background-color: rgba(16, 185, 129, 0.12);
}

.whitelist-connection-status.blocked {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.12);
}

.whitelist-connection-type {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    background-color: var(--bg-elev);
    color: var(--muted);
    border: 1px solid var(--border);
}

.whitelist-connection-type.web {
    color: #60a5fa;
    background-color: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.25);
}

.whitelist-connection-type.tcp {
    color: var(--muted);
}

.whitelist-add-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.whitelist-add-btn:hover {
    color: var(--accent-hover, var(--accent));
    opacity: 0.85;
}
