/* ============================================
   Workspaces Styles
   ============================================ */

/* Workspace List */
.workspace-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.workspace-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.workspace-row:hover {
    border-color: var(--color-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.workspace-row-editing {
    border-color: var(--color-text);
    box-shadow: 0 0 0 1px var(--color-text);
    cursor: default;
}

.workspace-row-add {
    border-style: dashed;
    background: transparent;
    cursor: default;
}

.workspace-row-add:hover {
    background: var(--color-surface);
    box-shadow: none;
}

.workspace-row-main {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex: 1;
}

.workspace-row-info {
    min-width: 180px;
}

.workspace-row-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0 0 var(--space-1);
}

.workspace-row-slug {
    font-size: var(--font-size-sm);
    font-family: var(--font-mono);
    color: var(--color-text-muted);
}

.workspace-row-stats {
    display: flex;
    gap: var(--space-6);
}

.workspace-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.workspace-stat-value {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    font-family: var(--font-mono);
}

.workspace-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workspace-row-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.workspace-role {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    padding: var(--space-1) var(--space-2);
    background: var(--color-gray-100);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.workspace-role.role-owner {
    background: var(--color-text);
    color: white;
}

.workspace-row-arrow {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    transition: transform 0.15s ease;
    text-decoration: none;
    padding: var(--space-2);
}

.workspace-row:hover .workspace-row-arrow {
    transform: translateX(4px);
    color: var(--color-text);
}

/* Button Icon */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    width: 36px;
    height: 36px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: var(--color-gray-100);
    border-color: var(--color-text);
    color: var(--color-text);
}

.btn-danger-icon:hover {
    background: var(--color-black);
    border-color: var(--color-black);
    color: white;
}

/* Workspace Forms */
.workspace-name-input {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    padding: var(--space-2) var(--space-3);
    width: 100%;
    max-width: 250px;
}

.workspace-edit-form,
.workspace-add-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: var(--space-4);
}

.input-error {
    border-color: var(--color-danger);
}

.text-error {
    color: var(--color-danger);
    display: block;
    margin-top: var(--space-1);
}

.text-sm {
    font-size: var(--font-size-sm);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    text-align: center;
    max-width: 400px;
    margin: var(--space-8) auto;
}

.empty-state-icon {
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--space-2);
    color: var(--color-text);
}

.empty-state-description {
    color: var(--color-text-muted);
    margin: 0 0 var(--space-6);
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: var(--color-white);
    border: 1px solid var(--color-black);
    border-radius: var(--radius);
    width: 100%;
    max-width: 450px;
    margin: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-black);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0;
    line-height: 1;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: var(--color-black);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0;
    color: var(--color-black);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-background);
    border-radius: 0 0 var(--radius) var(--radius);
}

.btn-danger {
    background: var(--color-black);
    color: var(--color-white);
    border: 1px solid var(--color-black);
}

.btn-danger:hover:not(:disabled) {
    background: var(--color-white);
    color: var(--color-black);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dashboard Stats */
.stats-row {
    display: flex;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.stat-item-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-mono);
    color: var(--color-text);
}

.stat-item-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Endpoint List */
.endpoint-list {
    display: flex;
    flex-direction: column;
}

.endpoint-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s ease;
}

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

.endpoint-row:hover {
    background: var(--color-gray-50);
}

.endpoint-row-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.endpoint-row-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.endpoint-row-token {
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    color: var(--color-text-muted);
}

.endpoint-row-dest {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.endpoint-row-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.endpoint-status {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding: 2px var(--space-2);
    background: var(--color-gray-100);
    border-radius: var(--radius-sm);
}

.endpoint-status.status-active {
    background: var(--color-text);
    color: white;
}

.endpoint-row-arrow {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    transition: transform 0.15s ease;
}

.endpoint-row:hover .endpoint-row-arrow {
    transform: translateX(3px);
    color: var(--color-text);
}

/* Endpoint Onboarding */
.endpoint-onboarding {
    padding: var(--space-6);
    text-align: center;
}

.endpoint-onboarding .onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    text-align: left;
    margin-bottom: var(--space-5);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.endpoint-onboarding .step-number {
    width: 36px;
    height: 36px;
    background: var(--color-text);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

.endpoint-onboarding .step-content h3 {
    margin: 0 0 var(--space-1);
    font-size: var(--font-size-lg);
}

.endpoint-onboarding .step-content p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.endpoint-onboarding .onboarding-action {
    margin-bottom: var(--space-5);
}

.endpoint-onboarding .onboarding-preview {
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

.endpoint-onboarding .preview-steps {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
}

.endpoint-onboarding .preview-step {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.endpoint-onboarding .preview-step.active {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.endpoint-onboarding .preview-step.completed {
    color: var(--color-text-secondary);
}

.endpoint-onboarding .preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
}

.endpoint-onboarding .preview-step.active .preview-dot {
    background: var(--color-text);
}

.endpoint-onboarding .preview-step.completed .preview-dot {
    background: var(--color-text-secondary);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .workspace-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .workspace-row-main {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        width: 100%;
    }

    .workspace-row-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .workspace-row-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: var(--space-3);
        border-top: 1px solid var(--color-border);
    }

    .workspace-edit-form,
    .workspace-add-form {
        flex-direction: column;
        align-items: stretch;
    }

    .workspace-name-input {
        max-width: none;
    }
}
